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

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

Closed
efedorenko opened this issue Jul 3, 2014 · 1 comment
Closed

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

efedorenko opened this issue Jul 3, 2014 · 1 comment

Comments

@efedorenko
Copy link
Contributor

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.

@tjschuck
Copy link
Member

tjschuck commented Jul 3, 2014

I believe this is a duplicate of #1729, allegedly solved by this (unmerged) PR: #1731

Closing this as a duplicate of that, but please let me know if I'm misreading and this is different and I'll reopen. Otherwise, please leave your feedback on those tickets.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants