fix path bugs
This commit is contained in:
@@ -8,15 +8,15 @@ export default class YEvent {
|
||||
const path = []
|
||||
let type = this.target
|
||||
const y = type._y
|
||||
while (type._parent !== this._currentTarget && type._parent !== y) {
|
||||
while (type !== this.currentTarget && type !== y) {
|
||||
let parent = type._parent
|
||||
if (type._parentSub !== null) {
|
||||
path.push(type._parentSub)
|
||||
path.unshift(type._parentSub)
|
||||
} else {
|
||||
// parent is array-ish
|
||||
for (let [i, child] of parent) {
|
||||
if (child === type) {
|
||||
path.push(i)
|
||||
path.unshift(i)
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user