mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-06 07:52:25 +02:00
Merge fix
This commit is contained in:
parent
8edb33f511
commit
1cb566a0f7
|
@ -874,28 +874,20 @@ export class Choices {
|
||||||
|
|
||||||
const hasShiftKey = e.shiftKey ? true : false;
|
const hasShiftKey = e.shiftKey ? true : false;
|
||||||
|
|
||||||
if(!this.dropdown.classList.contains(this.config.classNames.activeState)) {
|
if(!this.dropdown.classList.contains(this.config.classNames.activeState)) {
|
||||||
if(this.passedElement.type !== 'text') {
|
if(this.passedElement.type !== 'text') {
|
||||||
// For select inputs we always want to show the dropdown if it isn't already showing
|
// For select inputs we always want to show the dropdown if it isn't already showing
|
||||||
this.showDropdown();
|
this.showDropdown();
|
||||||
if(this.canSearch){
|
if(this.canSearch) {
|
||||||
this.input.focus();
|
this.input.focus();
|
||||||
}
|
|
||||||
}else{
|
|
||||||
// If input is not in focus, it ought to be
|
|
||||||
if(this.input !== document.activeElement) {
|
|
||||||
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) {
|
} else if(this.passedElement.type === 'select-one' && this.dropdown.classList.contains(this.config.classNames.activeState) && e.target === this.containerInner) {
|
||||||
this.hideDropdown();
|
this.hideDropdown();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue