mirror of
https://github.com/Choices-js/Choices.git
synced 2024-05-20 22:46:33 +02:00
(select-one) search = false, on blur hide dropdown
This commit is contained in:
parent
994e20a4c3
commit
611480ab3b
|
@ -1600,6 +1600,10 @@ export class Choices {
|
|||
|
||||
if(this.passedElement.type && this.passedElement.type === 'select-one') {
|
||||
this.containerOuter.addEventListener('focus', this._onFocus);
|
||||
|
||||
if(!this.canSearch) {
|
||||
this.containerOuter.addEventListener('blur', this._onBlur);
|
||||
}
|
||||
}
|
||||
|
||||
this.input.addEventListener('input', this._onInput);
|
||||
|
@ -1621,6 +1625,10 @@ export class Choices {
|
|||
|
||||
if(this.passedElement.type && this.passedElement.type === 'select-one') {
|
||||
this.containerOuter.removeEventListener('focus', this._onFocus);
|
||||
|
||||
if(!this.canSearch) {
|
||||
this.containerOuter.removeEventListener('blur', this._onBlur);
|
||||
}
|
||||
}
|
||||
|
||||
this.input.removeEventListener('input', this._onInput);
|
||||
|
|
Loading…
Reference in a new issue