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

Accordion Menu methods do not work with Responsive Navigation #11769

Closed
3 tasks done
scottsawyer opened this issue Jun 7, 2019 · 10 comments
Closed
3 tasks done

Accordion Menu methods do not work with Responsive Navigation #11769

scottsawyer opened this issue Jun 7, 2019 · 10 comments

Comments

@scottsawyer
Copy link

scottsawyer commented Jun 7, 2019

What should happen?

When using the Responsive Menu, all of the plugin methods for the different menu types referenced should work.

Example:
Accordion Menu has the following method:
$('#element').foundation('toggle', $target);
However, this and all other accordion menu methods do not work when using accordion with responsive menu.

...

What happens instead?

Uncaught ReferenceError: We're sorry, 'toggle' is not an available method for e.
...

Possible Solution

Best outcome would be that I have made a conceptual mistake and there is actually a way to trigger the submenu toggle with responsive menu.

Second best would be to enable all of the responsive menu plugin methods.

...

Test Case and/or Steps to Reproduce (for bugs)

Test Case: https://codepen.io/anon/pen/EzBXKy

In the console, run $('#my-menu').foundation('toggle', $target);

Set up a responsive menu with:
data-responsive-menu="drilldown medium-accordion"

Then try running any of the accordion menu methods.

Context

I am building a map of the US with a Responsive Menu of states and nested cities. I want users to be able to click a state on the map to open the corresponding submenu. Essentially, trigger a submenu via an outside trigger. Due to space constraints, I am using Drilldown menu on small and Accordion Menu on medium and up.
...

Your Environment

  • Foundation version(s) used: 6.5.3
  • Browser(s) name and version(s): 74.0.3729.157
  • Device, Operating System and version: ubuntu 16.04
  • Link to your project: https://codepen.io/anon/pen/EzBXKy

Checklist

  • I have read and follow the CONTRIBUTING.md document.
  • There are no other issues similar to this one.
  • The issue title and template are correctly filled.
@scottsawyer
Copy link
Author

scottsawyer commented Jun 7, 2019 via email

@DanielRuf
Copy link
Contributor

DanielRuf commented Jun 7, 2019

We have multiple issues here in Foundation Sites.

  1. the minified version does not use the original class names so it sets data-e and data-n instead of data-accordion-menu

Which results in

Uncaught ReferenceError: We're sorry, 'toggle' is not an available method for e.

Using the unminified version of Foundation Sites results in

Uncaught ReferenceError: We're sorry, 'toggle' is not an available method for ResponsiveMenu.

  1. Which is partly correct. It seems only the first plugin is checked and we can not use the other plugins which are applied as data attributes.

As this has no toggle method. See https://github.com/zurb/foundation-sites/blob/develop-v6.5/js/foundation.responsiveMenu.js

@DanielRuf
Copy link
Contributor

@DanielRuf
Copy link
Contributor

Minified results in

data-responsive-menu="drilldown medium-accordion"
data-multi-open="false"
data-n="85njhk-n"
data-mutate="kazl0v-responsive-menu"
data-e="65lzfp-e"

Unminified results in

data-responsive-menu="drilldown medium-accordion"
data-multi-open="false"
data-accordion-menu="1neo7n-accordion-menu"
data-mutate="abg98g-responsive-menu"

@scottsawyer
Copy link
Author

Do you think that pull will address this problem? Is it only a problem in the unminified version? Would I need the unminified version of all the plugins or just the responsiveMenu.js?

@DanielRuf
Copy link
Contributor

Using the unminified version of Foundation Sites results in

Uncaught ReferenceError: We're sorry, 'toggle' is not an available method for ResponsiveMenu.

  1. Which is partly correct. It seems only the first plugin is checked and we can not use the other plugins which are applied as data attributes.

There are probably more issues.

@scottsawyer
Copy link
Author

Yikes, that is bad news for my project.

Are you saying that the pull request you referenced in #11769 (comment) does not fix the underlying problem?

@DanielRuf
Copy link
Contributor

Exactly. Can you test if all previous versions are also affected (after 6.4.3 probably) so we can do some bisecting to find the commit which caused this?

This would be very helpful.

@scottsawyer
Copy link
Author

Well, I just switched to 6.4.3 in my pen and running:
$('#my-nav').foundation('showAll');
returns:
"We're sorry, 'showAll' is not an available method for e."
So, I am wonder if it ever worked.

@BreathingFlesh
Copy link

This still seems to be an issue. Has anybody got a solution for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants