-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Description
For Multiple Select, the width of .search-field input
does not fill the width of the perceived input of .chosen-choices
.
This is illustrated clearly in the following screenshot from the Chosen demo page at http://harvesthq.github.io/chosen/
This really becomes a problem when a user attempts to click inside the perceived input field after the field has been given focus. This actually causes the real input field to lose focus and potentially causes a lot of confusion for the user when clicking inside what looks like an input field doesn't actually give it focus.
It looks like there was a small mention of this issue in this thread (#407 (comment)), but it doesn't look like it was ever truly addressed.
Steps to reproduce:
- Click inside chosen multi select form to open dropdown and give focus to the input field
- Click the perceived input field near the right edge.
- Try to type, realize the input doesn't actually have focus.
Possible Solutions
- At first glance, it looks like a true solution would modify the inputs width depending on the width of
.chosen-choices
minus the width of any already selected values. We probably want to give the input some minimum width also, to prevent it from becoming confusingly narrow. - Alternatively, I guess you could just focus on the child
input
on any click events on.chosen-choices
.
Is there any interest in merging a solution to this issue? I'd be happy to cook up a pull request with either of the above solutions.