From d686c78fdf9f68212c68533988bda4380d1f6b77 Mon Sep 17 00:00:00 2001 From: Gazook89 Date: Sat, 25 Apr 2026 22:16:25 -0500 Subject: [PATCH] fix oddbird polyfill so custom properties are used correctly Co-authored-by: Copilot --- client/components/dropdown/dropdown.jsx | 8 +++++--- client/components/dropdown/dropdown.less | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/client/components/dropdown/dropdown.jsx b/client/components/dropdown/dropdown.jsx index bff8efec1..cc6f9cf59 100644 --- a/client/components/dropdown/dropdown.jsx +++ b/client/components/dropdown/dropdown.jsx @@ -28,13 +28,14 @@ const Dropdown = ({ groupName, className = null, icon, children, color = null, c const isSubMenu = depth > 0; const wrapperRef = useRef(null); + const triggerRef = useRef(null); const menuRef = useRef(null); - // Use setAttribute instead of the React style prop because React silently strips unknown CSS + // use setAttribute instead of the React style prop because React strips unknown CSS // properties (like anchor-name) from inline styles in browsers that don't support them. - // setAttribute writes raw CSS text that the anchor positioning polyfill can read. + // setAttribute writes raw CSS text that the anchor positioning polyfill can read useEffect(()=>{ - wrapperRef.current?.setAttribute('style', `anchor-name: ${anchorName}`); + triggerRef.current?.setAttribute('style', `anchor-name: ${anchorName}`); menuRef.current?.setAttribute('style', `position-anchor: ${anchorName}`); }, [anchorName]); @@ -78,6 +79,7 @@ const Dropdown = ({ groupName, className = null, icon, children, color = null, c aria-haspopup='menu' role='menuitem' disabled={children.length > 0 ? false : true} + ref={triggerRef} > {trigger(groupName)} diff --git a/client/components/dropdown/dropdown.less b/client/components/dropdown/dropdown.less index da418da6c..098961816 100644 --- a/client/components/dropdown/dropdown.less +++ b/client/components/dropdown/dropdown.less @@ -7,6 +7,7 @@ } .menu-list { + position : fixed; z-index : 1000; inset-block-start: anchor(bottom); inset-inline-start: anchor(left);