mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-21 17:48:27 +00:00
fix dropdown
This commit is contained in:
@@ -35,21 +35,6 @@ const Dropdown = ({ groupName, className = null, icon, children, color = null, c
|
|||||||
const triggerRef = useRef(null);
|
const triggerRef = useRef(null);
|
||||||
const menuRef = useRef(null);
|
const menuRef = useRef(null);
|
||||||
|
|
||||||
if(disabled){
|
|
||||||
return (
|
|
||||||
<li className={['menu-wrapper', className].filter(Boolean).join(' ')} role='none'>
|
|
||||||
<button
|
|
||||||
className={['menu-item', color].filter(Boolean).join(' ')}
|
|
||||||
aria-label={groupName}
|
|
||||||
role='menuitem'
|
|
||||||
disabled
|
|
||||||
>
|
|
||||||
{trigger(groupName, icon)}
|
|
||||||
</button>
|
|
||||||
</li>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// use setAttribute instead of the React style prop because React 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.
|
// 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
|
||||||
@@ -106,6 +91,21 @@ const Dropdown = ({ groupName, className = null, icon, children, color = null, c
|
|||||||
document.querySelectorAll('.menu-list:popover-open').forEach((openMenu)=>openMenu.hidePopover());
|
document.querySelectorAll('.menu-list:popover-open').forEach((openMenu)=>openMenu.hidePopover());
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if(disabled){
|
||||||
|
return (
|
||||||
|
<li className={['menu-wrapper', className].filter(Boolean).join(' ')} role='none'>
|
||||||
|
<button
|
||||||
|
className={['menu-item', color].filter(Boolean).join(' ')}
|
||||||
|
aria-label={groupName}
|
||||||
|
role='menuitem'
|
||||||
|
disabled
|
||||||
|
>
|
||||||
|
{trigger(groupName, icon)}
|
||||||
|
</button>
|
||||||
|
</li>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<li className={['menu-wrapper', className].filter(Boolean).join(' ')} role='none'>
|
<li className={['menu-wrapper', className].filter(Boolean).join(' ')} role='none'>
|
||||||
<button
|
<button
|
||||||
|
|||||||
Reference in New Issue
Block a user