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

DropdownMenu click close on Mozilla #9470

Closed
stephane-r opened this issue Dec 8, 2016 · 15 comments
Closed

DropdownMenu click close on Mozilla #9470

stephane-r opened this issue Dec 8, 2016 · 15 comments
Assignees

Comments

@stephane-r
Copy link

stephane-r commented Dec 8, 2016

How can we reproduce this bug?
When the DropdownMenu is open (on click only), i can't close this on second click with Mozilla (last version). It work on Chrome and IE (last version).

I've add data-disable-hover="true" for enable click only. But don't work for close my submenu.

Test case:
Codepen test case.

Maybe i need other data argument ?

@ncoden
Copy link
Contributor

ncoden commented Dec 8, 2016

Hi @Leg3ndz,

What is your Foundation version ?
I tested with chrome (v54), it don't work neither. But it is expected: if you disable the open on Hover, you have to enable the open on Click. Add data-click-open="true" to your dropdown (Codepen).

The documentation is incorrect about the default value of data-click-open, see #9464.

I am working on it.

@stephane-r
Copy link
Author

stephane-r commented Dec 8, 2016

Hi @ncoden

I've test your Codepen, it don't work on my Mozilla, but work on Chrome (the second clic on "Item 1" for close the submenu).
I use last version of Foundation.

@ncoden
Copy link
Contributor

ncoden commented Dec 8, 2016

I tested for Foundation v6.2.1 and v6.2.4 on Firefox for Mac v50.0.1 and v50.0.2. It works for me (GIF).

@brettsmason Could you test this on Firefox for Windows ?

@Leg3ndz Can you give your version number of:

  • Foundation (in package.json)
  • Mozilla Firefox

Thank you.

@stephane-r
Copy link
Author

stephane-r commented Dec 8, 2016

I use :

  • Foundation 6.2.4
  • Mozilla Firefox 50.0.2

My code for init DropdownMenu :

new Foundation.DropdownMenu($elem);
Foundation.DropdownMenu.defaults.disableHover = true; Foundation.DropdownMenu.defaults.clickOpen = true;

Example on my Mozilla, your can see the second click refresh my page :

submenu

Thank you for your support

@ncoden
Copy link
Contributor

ncoden commented Dec 8, 2016

So the click refresh your page when the dropdown is open. I still can't reproduce 😕 (https://codepen.io/anon/pen/gLKWgj)

  • What about the Copepen you given ?
  • Can you provide the HTML markup of your DropdownMenu (in pastebin) ?
  • Do you have a link to the current page (or to an other page) on your DropdownMenu ? If yes, you shouldn't.

@stephane-r
Copy link
Author

stephane-r commented Dec 8, 2016

Sorry, my example is local only.

I can reproduce my problem on your code pen : the second click on "Item 1" open my href
submenu2

@ncoden
Copy link
Contributor

ncoden commented Dec 8, 2016

Ok. This should be on Firefox for Windows only. We'll wait the @brettsmason's test (he did the 6.3.0-rc QA on Firefox for Windows).

@stephane-r
Copy link
Author

I see same problem with Safari 10 (iPad), tested on Codepen only.

@brettsmason
Copy link
Contributor

@ncoden sorry playing catchup. So its this Codepen that needs testing right? https://codepen.io/anon/pen/gLKWgj

So if I understand this correctly, clicking on the Item 1 link in this Codepen when the submenu is open navigates to that link?

@ncoden
Copy link
Contributor

ncoden commented Dec 8, 2016

@brettsmason This would be the bug, yes.

@brettsmason
Copy link
Contributor

@ncoden I tried it in Firefox for Windows (50.0.2) and can't recreate this bug.
I tried your Codepen, and also created a visual test in the RC1 version I have locally, and seems to work correctly.

@ncoden
Copy link
Contributor

ncoden commented Dec 8, 2016

@Leg3ndz With https://codepen.io/anon/pen/gLKWgj, do you have errors in the console ?

@stephane-r
Copy link
Author

@ncoden No errors in the console :(. I did test my friend, no bug on his side. But, i can recreate the bug on Safari 10 iPad :/

@kball
Copy link
Contributor

kball commented Dec 8, 2016

Hmm... so this appears to be related to touch devices and the forceFollow option. For reasons that I do not understand, it appears that by default if when a dropdown contains a link, on touch devices the second touch will follow that link rather than closing the dropdown.

I'm not sure why this is the case; unfortunately the commit message for the commit adding it is not very communicative e89d0cb

The workaround is to add data-force-follow="false" to your dropdown menu

kball added a commit that referenced this issue Dec 8, 2016
Fix missing declaration found while tracking down #9470
@stephane-r
Copy link
Author

Hi @kball

Thank you, Foundation.DropdownMenu.defaults.forceFollow = false; work nice !

My Mozilla isn't touch devices, it's on PC. But it work, than you for your support every body :)

@ncoden ncoden closed this as completed Dec 15, 2016
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