From 1cb566a0f7694b99f42aae8817abf53a6e2b61af Mon Sep 17 00:00:00 2001 From: Simon Babay Date: Mon, 1 Aug 2016 21:30:31 +0200 Subject: [PATCH] Merge fix --- assets/scripts/src/choices.js | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/assets/scripts/src/choices.js b/assets/scripts/src/choices.js index c157296..b6d6f38 100644 --- a/assets/scripts/src/choices.js +++ b/assets/scripts/src/choices.js @@ -874,28 +874,20 @@ export class Choices { const hasShiftKey = e.shiftKey ? true : false; - if(!this.dropdown.classList.contains(this.config.classNames.activeState)) { - if(this.passedElement.type !== 'text') { - // For select inputs we always want to show the dropdown if it isn't already showing - this.showDropdown(); - if(this.canSearch){ - this.input.focus(); - } - }else{ - // If input is not in focus, it ought to be - if(this.input !== document.activeElement) { - this.input.focus(); - } + if(!this.dropdown.classList.contains(this.config.classNames.activeState)) { + if(this.passedElement.type !== 'text') { + // For select inputs we always want to show the dropdown if it isn't already showing + this.showDropdown(); + if(this.canSearch) { + this.input.focus(); } + }else{ + // If input is not in focus, it ought to be + if(this.input !== document.activeElement) { + this.input.focus(); + } + } - } else if(this.passedElement.type === 'select-one' && this.dropdown.classList.contains(this.config.classNames.activeState) && e.target === this.containerInner) { - this.hideDropdown(); - } - - // If input is not in focus, it ought to be - if(this.input !== document.activeElement) { - this.input.focus(); - } } else if(this.passedElement.type === 'select-one' && this.dropdown.classList.contains(this.config.classNames.activeState) && e.target === this.containerInner) { this.hideDropdown(); }