mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-08 08:52:19 +02:00
Close dropdown for single select boxes without search on blur
This commit is contained in:
parent
01c735afa7
commit
97451458ae
4
assets/scripts/dist/choices.min.js
vendored
4
assets/scripts/dist/choices.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -1223,8 +1223,9 @@ export class Choices {
|
|||
// Remove the focus state
|
||||
this.containerOuter.classList.remove(this.config.classNames.focusState);
|
||||
|
||||
// Close the dropdown if there is one
|
||||
if(hasActiveDropdown && e.target === this.input) {
|
||||
// Close the dropdown if it is active, the input is the target (select-multiple, text, select-one (with search))
|
||||
// or the outer container is the target with no search (select-one)
|
||||
if(hasActiveDropdown && (e.target === this.input || e.target === this.containerOuter && !this.canSearch)) {
|
||||
this.hideDropdown();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue