(select-one) search = false, on blur hide dropdown

This commit is contained in:
Simon Babay 2016-08-01 15:36:29 +02:00
parent 994e20a4c3
commit 611480ab3b

View file

@ -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);