mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2025-12-12 11:20:11 +00:00
fix: 修复React17选中组件bug
This commit is contained in:
parent
57657fd76d
commit
750d282c03
@ -73,7 +73,10 @@ function cacheReactKey(el: Element): Element {
|
|||||||
if (REACT_KEY !== '') {
|
if (REACT_KEY !== '') {
|
||||||
return el;
|
return el;
|
||||||
}
|
}
|
||||||
REACT_KEY = Object.keys(el).find((key) => key.startsWith('__reactInternalInstance$')) || '';
|
// react17 采用 __reactFiber 开头
|
||||||
|
REACT_KEY = Object.keys(el).find(
|
||||||
|
(key) => key.startsWith('__reactInternalInstance$') || key.startsWith('__reactFiber$'),
|
||||||
|
) || '';
|
||||||
if (!REACT_KEY && (el as HTMLElement).parentElement) {
|
if (!REACT_KEY && (el as HTMLElement).parentElement) {
|
||||||
return cacheReactKey((el as HTMLElement).parentElement!);
|
return cacheReactKey((el as HTMLElement).parentElement!);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -530,7 +530,10 @@ function cacheReactKey(el: Element): Element {
|
|||||||
if (REACT_KEY !== '') {
|
if (REACT_KEY !== '') {
|
||||||
return el;
|
return el;
|
||||||
}
|
}
|
||||||
REACT_KEY = Object.keys(el).find((key) => key.startsWith('__reactInternalInstance$')) || '';
|
// react17 采用 __reactFiber 开头
|
||||||
|
REACT_KEY = Object.keys(el).find(
|
||||||
|
(key) => key.startsWith('__reactInternalInstance$') || key.startsWith('__reactFiber$'),
|
||||||
|
) || '';
|
||||||
if (!REACT_KEY && (el as HTMLElement).parentElement) {
|
if (!REACT_KEY && (el as HTMLElement).parentElement) {
|
||||||
return cacheReactKey((el as HTMLElement).parentElement!);
|
return cacheReactKey((el as HTMLElement).parentElement!);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user