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

Support <label> tag #99

Open
cthiebault opened this issue Oct 4, 2013 · 2 comments
Open

Support <label> tag #99

cthiebault opened this issue Oct 4, 2013 · 2 comments

Comments

@cthiebault
Copy link

GwtChosen does not support label tag.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label

It would be nice if when we click on label element, it opens the item list...

@meriouma
Copy link
Member

Not sure this can be done, since Chosen hides the native select to replace it with a div, and the label isn't supposed to contain a div

@jDramaix jDramaix reopened this Mar 30, 2015
@jDramaix
Copy link
Contributor

we could support that. The only thing we have to do is to find the label element either by checking if the select is not included in a label or by querying the dom to search a label element with attribute for equals to the id of the select element ($("label[for='mySelectId']")

Once the label is found, just add a click handler on it that will put the focus on the chosen element.

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