Skip to content

Multi Select: .search-field input width does not fill width of .chosen-choices #1729

@jordanstephens

Description

@jordanstephens

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/

screen shot 2014-01-15 at 6 47 43 pm

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:

  1. Click inside chosen multi select form to open dropdown and give focus to the input field
  2. Click the perceived input field near the right edge.
  3. Try to type, realize the input doesn't actually have focus.

Possible Solutions

  1. 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.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions