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

onCartPreviewOpen() handler stops Foundation dropdowns from working in Mobile Nav Menu #2246

Open
pvaladez opened this issue Aug 18, 2022 · 0 comments
Assignees

Comments

@pvaladez
Copy link
Contributor

Expected behavior

You should be able to move a component using a Foundation dropdown inside the mobile menu. For example, you should be able to move the Currency Selector component into the mobile nav.

Actual behavior

When the Currency Selector component is moved into the mobile nav, clicking on the Currency Selector dropdown causes the mobile nav to close.

The cause of this is the onCartPreviewOpen() handler in mobile-menu-toggle.js. The CartPreviewEvents.open event used here is a generic foundation dropdown open event, and any event generated in the header triggers this handler. The issue could potentially be fixed by adding a selector to the jQuery .on() call like this:

this.$header.on(CartPreviewEvents.open, '#cart-preview-dropdown', this.onCartPreviewOpen);

Steps to reproduce behavior

Place the Currency Selector component in the mobile nav menu, I'll say line 29 of navigation-menu.html. Then open the mobile nav menu on a mobile device and watch the mobile menu close when you click on the Currency Selector dropdown.

@pvaladez pvaladez changed the title Unneeded onCartPreviewOpen() handler stops Foundation dropdowns from working in Mobile Nav Menu onCartPreviewOpen() handler stops Foundation dropdowns from working in Mobile Nav Menu Aug 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants