feat(react/widgets): global menu with zoom controls

This commit is contained in:
Elian Doran
2025-08-29 00:47:47 +03:00
parent 4ef103063d
commit 829f382726
10 changed files with 255 additions and 456 deletions

View File

@@ -18,9 +18,10 @@ export interface DropdownProps {
noSelectButtonStyle?: boolean;
disabled?: boolean;
text?: ComponentChildren;
forceShown?: boolean;
}
export default function Dropdown({ className, buttonClassName, isStatic, children, title, text, dropdownContainerStyle, dropdownContainerClassName, hideToggleArrow, iconAction, disabled, noSelectButtonStyle }: DropdownProps) {
export default function Dropdown({ className, buttonClassName, isStatic, children, title, text, dropdownContainerStyle, dropdownContainerClassName, hideToggleArrow, iconAction, disabled, noSelectButtonStyle, forceShown }: DropdownProps) {
const dropdownRef = useRef<HTMLDivElement | null>(null);
const triggerRef = useRef<HTMLButtonElement | null>(null);
@@ -30,8 +31,12 @@ export default function Dropdown({ className, buttonClassName, isStatic, childre
if (!triggerRef.current) return;
const dropdown = BootstrapDropdown.getOrCreateInstance(triggerRef.current);
if (forceShown) {
dropdown.show();
setShown(true);
}
return () => dropdown.dispose();
}, []); // Add dependency array
}, []);
const onShown = useCallback(() => {
setShown(true);