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

Enable dropdown buttons to work with child elements #49

Closed
nevf opened this issue Aug 29, 2017 · 3 comments
Closed

Enable dropdown buttons to work with child elements #49

nevf opened this issue Aug 29, 2017 · 3 comments
Labels
bug Things that aren't working right in the library.

Comments

@nevf
Copy link

nevf commented Aug 29, 2017

I am using the following dropdown markup which only works for a click on the caret vs. click anywhere inside the tag.

<a href="#" class="dropdown-trigger a-user-menu">
  <i class="icon-user"></i>
  <span id="user-name"></span>
</a>

To resolve this I changed:

if($(event.target).is('.dropdown-trigger'))

to:

if($(event.target).closest('.dropdown-trigger'))

in dropdowns.js which works with just an <a></a> etc. and if it has nested elements.

@claviska claviska added the bug Things that aren't working right in the library. label Aug 29, 2017
@claviska
Copy link
Member

Good call. Fixed!

@claviska
Copy link
Member

Just pushed a proper fix for this since there were some side effects with using .closest(). It also introduces a bug where menu items won't be properly selected. See 75e4582.

@nevf
Copy link
Author

nevf commented Aug 31, 2017

@claviska Thanks for the heads up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Things that aren't working right in the library.
Projects
None yet
Development

No branches or pull requests

2 participants