-
Notifications
You must be signed in to change notification settings - Fork 50
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
Dropdown closes when label with 'for' tag is clicked #85
Comments
Hi Daniel, I'm pretty sure the |
You're right that it's not required (and indeed our current workaround is to not use the id). I just thought it's a bit of a weird gotcha to have the dropdown close in this case. I'm not well-versed in the DOM event system, but wouldn't calling stopPropagation() on the event potentially break other event handlers? Or should it only be called in some cases? Then we're maybe back at the ng-digest mismatch making it difficult to detect when it's appropriate. |
I might not have been clear here, but I was referring toggle function. You'll also need to change Alternatively maybe try:
The easiest thing would probably just be to leave the superfluous |
We've run into an issue where giving a label a
for
id causes the dropdown to close when the label is clicked (but not when the checkbox itself is clicked directly)It seems this is because there are two click events triggered (one for the label, and a second one for the input element) but somewhere in between setting the event's target, and checking whether the clicked element is contained in the dropdown pane, angular does a digest cycle causing the comparison here to fail:
https://github.com/circlingthesun/angular-foundation-6/blob/master/src/dropdownToggle/dropdownToggle.js#L53
I'm not 100% sure how to deal with is so I figured I'd open an issue for discussion before trying to fix it myself.
The text was updated successfully, but these errors were encountered: