fix(ui): keep tree information menus within viewport bounds
This commit is contained in:
@@ -4742,4 +4742,4 @@ textarea.nodedc-field__control {
|
||||
}
|
||||
|
||||
.nodedc-tree__actions {display:flex;flex:none;align-items:center;}
|
||||
.nodedc-tree__actions .nodedc-icon-button {width:24px;height:24px;min-width:24px;padding:0;}
|
||||
.nodedc-tree__actions .nodedc-icon-button {flex:0 0 24px;width:24px;height:24px;min-width:24px;padding:0;}
|
||||
|
||||
@@ -126,6 +126,13 @@ export function Dropdown({
|
||||
updatePosition();
|
||||
}, [isOpen, updatePosition]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isOpen || !surfaceRef.current) return;
|
||||
const observer = new ResizeObserver(updatePosition);
|
||||
observer.observe(surfaceRef.current);
|
||||
return () => observer.disconnect();
|
||||
}, [isOpen, updatePosition]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isOpen || !getAnchorRect) return;
|
||||
let frame:number;
|
||||
|
||||
Reference in New Issue
Block a user