Skip to content

Clicking on a field won't make it focused #2003

@efedorenko

Description

@efedorenko

Steps to reproduce on official demo:

  1. Click on Multiple Select field.
  2. Enter "xxx" or anything else to get a "No results" message.
  3. Click on the far right side of the field (or on "No results" message).
  4. Focus is lost and clicking on a field won't make it focused anymore. The only way to get focus back is to click right on text, not just on the field itself.

In reality there are more cases when this issue can be reproduced.

This happens because width of input in .search-field is smaller than width of .chosen-choices. When you click outside input field the blur.chosen event happens but function AbstractChosen.prototype.input_blur doesn't proceed because this.mouse_on_container is set to true at this moment. This is the only place where this.mouse_on_container is actually checked and I couldn't find any good reason why it's required. Can you guys shed some light on why this is needed?

Without this check blur event does its job of setting active_field to true, and then adding else condition in choices_click with this.input_focus(); fixes this issue. I'll be happy to create a pull request with a fix.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions