fix: 修复画布上无法选中节点的 bug

This commit is contained in:
lihao.ylh 2022-05-25 14:44:08 +08:00
parent 91252fa1b0
commit 9c979bc45c

View File

@ -551,7 +551,7 @@ function cacheReactKey(el: Element): Element {
}
REACT_KEY = Object.keys(el).find(
(key) => key.startsWith('__reactInternalInstance$') || key.startsWith('__reactFiber$'),
);
) || '';
if (!REACT_KEY && (el as HTMLElement).parentElement) {
return cacheReactKey((el as HTMLElement).parentElement!);
}