Closed taauntik closed 3 weeks ago
I think need to add this in defaults
in changeMenu
inside MenuItem.js
:
focusOnHover : config.lazyItems.focusOnHover,
The config is working fine. It just has to be used in the correct place, in the config block of a Menu
MenuItem.js
needs:
changeMenu(config, existingMenu) {
const
me = this,
{ owner } = me,
{ constrainTo, scrollAction, focusOnHover } = owner,
options = {
owner : me,
defaults : {
type : 'menu',
align : 's0-e0',
anchor : true,
autoClose : true,
autoShow : false,
cls : {
'b-sub-menu' : 1 // Marks the widget as a submenu
},
forElement : me.element,
owner : me,
ariaLabel : me.text,
constrainTo,
scrollAction
}
};
// This covers both Array and Object which are valid items config formats.
// menu could be { itemRef : { text : 'sub item 1 } }. But if it has
// child items or html property in it, it's the main config
if (config && typeof config === 'object' && !('items' in config) && !('widgets' in config) && !('html' in config)) {
config = {
lazyItems : config
};
}
// Propagate focusOnHover down the menu hierarchy
if (owner.isMenu) {
me.closeParent = focusOnHover;
options.focusOnHover = focusOnHover;
}
return Menu.reconfigure(existingMenu, config, options);
}
Forum post
MenuItem.js
needs to use its parent menu'sfocusOnHover
when configuring its own submenu.