|
@@ -1,4 +1,4 @@
|
|
|
-import { closestRoot } from '../lifecycle'
|
|
|
+import { closestRoot, findClosest } from '../lifecycle'
|
|
|
import { mergeProxies } from '../scope'
|
|
|
import { magic } from '../magics'
|
|
|
|
|
@@ -13,13 +13,9 @@ magic('refs', el => {
|
|
|
function getArrayOfRefObject(el) {
|
|
|
let refObjects = []
|
|
|
|
|
|
- let currentEl = el
|
|
|
-
|
|
|
- while (currentEl) {
|
|
|
- if (currentEl._x_refs) refObjects.push(currentEl._x_refs)
|
|
|
-
|
|
|
- currentEl = currentEl.parentNode
|
|
|
- }
|
|
|
+ findClosest(el, (i) => {
|
|
|
+ if (i._x_refs) refObjects.push(i._x_refs)
|
|
|
+ })
|
|
|
|
|
|
return refObjects
|
|
|
}
|