-
Notifications
You must be signed in to change notification settings - Fork 594
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
<label><select></label> doesn't open when clicked #57
Comments
It immediately closes because the focus is no longer on the actual input, it is on the label (as far as I know). By testing whether the passed input is wrapped within a label, this could be resolved. I'm just wondering whether it is a normal pattern wrapping a select input within a label? I've not come across that before 🤔 |
Yes it is! w3 spec recommends it, and has many examples of it:
It lets the entire label + input + the box around it be clickable to focus on the input. ALA says it's a good practice to do: http://www.alistapart.com/articles/prettyaccessibleforms/ |
Afaik it works like this: clicking a |
Ah that seems to behave the same as supplying a Interesting. |
Thanks so much by the way for choices. I've been fed up with Select2 for a while :-) |
I'm glad you like it! I've just tried wrapping a multiple select element within a label on Chrome and it worked fine. Would you mind sending me your browser details please? Thanks |
Hey, any chance you could send me your browser details please? Thanks |
We've noticed this (or similar issue as well). In short, when wrapping a Observations:
Here's a codepen: https://codepen.io/khawkins98/pen/aWBOwP Any initial thoughts/suggestions? Tested in Chrome 57, FireFox 52 (Mac). |
I see the same issue. When it is wrapped in the label it does not work. Chrome 62 stable on macOS 10.12 |
Got the same issue, not sure why this issue has been closed? @jshjohnson |
Closed due to lack of information of browser. |
Hey friends, the workaround is to not nest your select elements inside a label. Instead, use |
|
Yes it is, but Choices.js doesn't support this at the moment. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I have something like this:
But I can't click it. I can press spacebar on it just fine, though.
It seems like it opens the dropdown, then closes it immediately:
this
is indeed !==this.input
. andthis.dropdown
indeed doesn't havetarget
:What happens here is that two
click
events happen.The text was updated successfully, but these errors were encountered: