Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

focusOnHover not working for submenu #9757

Closed
taauntik opened this issue Aug 6, 2024 · 3 comments
Closed

focusOnHover not working for submenu #9757

taauntik opened this issue Aug 6, 2024 · 3 comments
Assignees
Labels
bug Something isn't working forum Issues from forum large-account Reported by large customer resolved Fixed but not yet released (available in the nightly builds)
Milestone

Comments

@taauntik
Copy link

taauntik commented Aug 6, 2024

Forum post

MenuItem.js needs to use its parent menu's focusOnHover when configuring its own submenu.

@taauntik taauntik added bug Something isn't working forum Issues from forum large-account Reported by large customer labels Aug 6, 2024
@ghulamghousdev
Copy link
Member

I think need to add this in defaults in changeMenu inside MenuItem.js:

focusOnHover : config.lazyItems.focusOnHover,

@ExtAnimal ExtAnimal added the invalid This doesn't seem right label Aug 6, 2024
@ExtAnimal
Copy link

The config is working fine. It just has to be used in the correct place, in the config block of a Menu

@matsbryntse matsbryntse removed the invalid This doesn't seem right label Aug 6, 2024
@matsbryntse matsbryntse reopened this Aug 6, 2024
@ExtAnimal
Copy link

ExtAnimal commented Aug 7, 2024

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);
    }

@ghulamghousdev ghulamghousdev self-assigned this Aug 7, 2024
@ghulamghousdev ghulamghousdev added the ready for review Issue is fixed, the pull request is being reviewed label Aug 7, 2024
@isglass isglass added resolved Fixed but not yet released (available in the nightly builds) and removed ready for review Issue is fixed, the pull request is being reviewed labels Aug 8, 2024
@isglass isglass added this to the 6.0.5 milestone Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working forum Issues from forum large-account Reported by large customer resolved Fixed but not yet released (available in the nightly builds)
Projects
None yet
Development

No branches or pull requests

5 participants