Fixed #2886 - Dropdown: Prevent show of overlay when pressing meta key
parent
a7a70aba97
commit
e3a87ea5e3
|
@ -225,6 +225,8 @@ export default {
|
|||
return;
|
||||
}
|
||||
|
||||
const metaKey = event.metaKey || event.ctrlKey;
|
||||
|
||||
switch (event.code) {
|
||||
case 'ArrowDown':
|
||||
this.onArrowDownKey(event);
|
||||
|
@ -275,7 +277,7 @@ export default {
|
|||
break;
|
||||
|
||||
default:
|
||||
if (ObjectUtils.isPrintableCharacter(event.key)) {
|
||||
if (!metaKey && ObjectUtils.isPrintableCharacter(event.key)) {
|
||||
!this.overlayVisible && this.show();
|
||||
this.searchOptions(event, event.key);
|
||||
}
|
||||
|
|
|
@ -287,6 +287,8 @@ export default {
|
|||
this.$emit('blur', event);
|
||||
},
|
||||
onKeyDown(event) {
|
||||
const metaKey = event.metaKey || event.ctrlKey;
|
||||
|
||||
switch (event.code) {
|
||||
case 'ArrowDown':
|
||||
this.onArrowDownKey(event);
|
||||
|
@ -343,7 +345,7 @@ export default {
|
|||
break;
|
||||
|
||||
default:
|
||||
if (ObjectUtils.isPrintableCharacter(event.key)) {
|
||||
if (!metaKey && ObjectUtils.isPrintableCharacter(event.key)) {
|
||||
!this.overlayVisible && this.show();
|
||||
!this.editable && this.searchOptions(event, event.key);
|
||||
}
|
||||
|
|
|
@ -221,6 +221,8 @@ export default {
|
|||
this.$emit('blur', event);
|
||||
},
|
||||
onListKeyDown(event) {
|
||||
const metaKey = event.metaKey || event.ctrlKey;
|
||||
|
||||
switch (event.code) {
|
||||
case 'ArrowDown':
|
||||
this.onArrowDownKey(event);
|
||||
|
@ -261,7 +263,7 @@ export default {
|
|||
break;
|
||||
|
||||
default:
|
||||
if (event.code === 'KeyA' && this.multiple && (event.metaKey || event.ctrlKey)) {
|
||||
if (this.multiple && event.code === 'KeyA' && metaKey) {
|
||||
const value = this.visibleOptions.filter(option => this.isValidOption(option)).map(option => this.getOptionValue(option));
|
||||
this.updateModel(event, value);
|
||||
|
||||
|
@ -269,7 +271,7 @@ export default {
|
|||
break;
|
||||
}
|
||||
|
||||
if (ObjectUtils.isPrintableCharacter(event.key)) {
|
||||
if (!metaKey && ObjectUtils.isPrintableCharacter(event.key)) {
|
||||
this.searchOptions(event, event.key);
|
||||
event.preventDefault();
|
||||
}
|
||||
|
|
|
@ -336,6 +336,8 @@ export default {
|
|||
this.$emit('blur', event);
|
||||
},
|
||||
onKeyDown(event) {
|
||||
const metaKey = event.metaKey || event.ctrlKey;
|
||||
|
||||
switch (event.code) {
|
||||
case 'ArrowDown':
|
||||
this.onArrowDownKey(event);
|
||||
|
@ -380,7 +382,7 @@ export default {
|
|||
break;
|
||||
|
||||
default:
|
||||
if (event.code === 'KeyA' && (event.metaKey || event.ctrlKey)) {
|
||||
if (event.code === 'KeyA' && metaKey) {
|
||||
const value = this.visibleOptions.filter(option => this.isValidOption(option)).map(option => this.getOptionValue(option));
|
||||
this.updateModel(event, value);
|
||||
|
||||
|
@ -388,7 +390,7 @@ export default {
|
|||
break;
|
||||
}
|
||||
|
||||
if (ObjectUtils.isPrintableCharacter(event.key)) {
|
||||
if (!metaKey && ObjectUtils.isPrintableCharacter(event.key)) {
|
||||
!this.overlayVisible && this.show();
|
||||
this.searchOptions(event);
|
||||
event.preventDefault();
|
||||
|
|
Loading…
Reference in New Issue