fix historyversion

This commit is contained in:
Víctor Losada Hernández
2026-09-30 22:05:37 +02:00
parent e3d3289d8d
commit d3c186aa5f
4 changed files with 86 additions and 34 deletions
+17 -2
View File
@@ -22,7 +22,7 @@ import _ from 'lodash';
// use react context to keep track of the menu depth (menus in menus)
const MenuDepthContext = React.createContext(0);
const Dropdown = ({ groupName, className = null, icon, children, color = null, customTrigger, ...props })=>{
const Dropdown = ({ groupName, className = null, icon, children, color = null, customTrigger, disabled, ...props })=>{
const reactId = useId();
const safeId = reactId.replace(/[^a-zA-Z0-9_-]/g, '');
const menuId = `${_.kebabCase(groupName)}-${safeId}-menu`;
@@ -35,6 +35,21 @@ const Dropdown = ({ groupName, className = null, icon, children, color = null, c
const triggerRef = 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
// 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
@@ -92,7 +107,7 @@ const Dropdown = ({ groupName, className = null, icon, children, color = null, c
};
return (
<li className='menu-wrapper' role='none'>
<li className={['menu-wrapper', className].filter(Boolean).join(' ')} role='none'>
<button
id={`${menuId}-trigger`}
className={['menu-item', color].join(' ')}
+3
View File
@@ -11,6 +11,9 @@
}
:root { --activeTriggerColor : var(--activeTriggerColor); }
.menu-wrapper {
list-style: none;
}
.menu-list {
position : fixed;
top : anchor(bottom);