-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Fix submenus not opening on click #36290
Conversation
Size Change: 0 B Total Size: 1.08 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although I haven't been able to reproduce the original issue, this change works, and it doesn't hurt to make super sure that event listeners will be added at an appropriate time. Thank you, LGTM!
Cherry-picked into the GB 11.9 release in e7e5305 |
Description
Open on click functionality in Navigation Submenus is broken. A bit of poking around showed the event listener wasn't being added to the buttons, probably because the script is being loaded before the markup is present on the page.
This PR changes the script to only add the event listeners after the DOM is fully loaded.
How has this been tested?
Add a Navigation block with a few menu items and Submenus. Set it to open on click.
Save and visit the page on the front end. Check that submenus open on click, and close on click or focus outside.
Screenshots
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist:
*.native.js
files for terms that need renaming or removal).