Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Setting disable_search to true on selects contained in pop out windows prevents the select from closing on click away #1739

Closed
m-orchard opened this issue Jan 23, 2014 · 2 comments · Fixed by #1745

Comments

@m-orchard
Copy link

In Chosen.prototype.container_mousedown, 'click.chosen' is bound to $(document). This prevents pop out windows from closing their Chosen selects on click away, as document references the parent document rather than the pop out window document

This only occurs if disable_search is set to true, because it prevents the input from triggering a blur on click away. When disable_search is false, that blur will close the select.

I'd suggest fixing by instead binding to $(this.container[0].ownerDocument), and therefore also unbinding from that in Chosen.prototype.destroy and Chosen.prototype.close_field.

@stof
Copy link
Collaborator

stof commented Jan 23, 2014

this change looks good. Would you mind submitting a pull request with the fix (in the jQuery and Prototype versions) ?

@m-orchard
Copy link
Author

Sure, I've made one here - #1745.

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

Successfully merging a pull request may close this issue.

2 participants