Fixes keys for new react version (#948)
* Fix for new react version * Fix CustomCSS editor. * Fix Dropdown Menus. * Update drodown.jsx * Remove unused variable Fixes #949 Fixes #950
This commit is contained in:
parent
65dc214ffe
commit
87efffb7e8
|
@ -67,7 +67,7 @@ export default new class CustomCSS extends Builtin {
|
||||||
if (this.isDetached) return;
|
if (this.isDetached) return;
|
||||||
if (this.nativeOpen) return this.openNative();
|
if (this.nativeOpen) return this.openNative();
|
||||||
else if (this.startDetached) return this.openDetached(this.savedCss);
|
else if (this.startDetached) return this.openDetached(this.savedCss);
|
||||||
const settingsView = Utilities.findInRenderTree(thisObject._reactInternalFiber, m => m && m.onSetSection, {walkable: ["child", "memoizedProps", "props", "children"]});
|
const settingsView = Utilities.findInRenderTree(thisObject._reactInternals, m => m && m.onSetSection, {walkable: ["child", "memoizedProps", "props", "children"]});
|
||||||
if (settingsView && settingsView.onSetSection) settingsView.onSetSection(this.id);
|
if (settingsView && settingsView.onSetSection) settingsView.onSetSection(this.id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -278,7 +278,7 @@ export default class Utilities {
|
||||||
|
|
||||||
static getReactInstance(node) {
|
static getReactInstance(node) {
|
||||||
if (node.__reactInternalInstance$) return node.__reactInternalInstance$;
|
if (node.__reactInternalInstance$) return node.__reactInternalInstance$;
|
||||||
return node[Object.keys(node).find(k => k.startsWith("__reactInternalInstance"))] || null;
|
return node[Object.keys(node).find(k => k.startsWith("__reactInternalInstance") || k.startsWith("__reactFiber"))] || null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -13,7 +13,11 @@ export default class Select extends React.Component {
|
||||||
|
|
||||||
showMenu(event) {
|
showMenu(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
this.setState({open: true}, () => {
|
event.stopPropagation();
|
||||||
|
|
||||||
|
this.setState((state) => ({open: !state.open}), () => {
|
||||||
|
if (!this.state.open) return;
|
||||||
|
|
||||||
document.addEventListener("click", this.hideMenu);
|
document.addEventListener("click", this.hideMenu);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue