don't block enter/tab for items with valueProvider

This commit is contained in:
LenAnderson 2024-06-23 12:07:24 -04:00
parent ab5a6b1c61
commit 5862c7ea91
2 changed files with 6 additions and 0 deletions

View File

@ -721,6 +721,7 @@ export class AutoComplete {
// pick the selected item to autocomplete
if (evt.ctrlKey || evt.altKey || evt.shiftKey || this.selectedItem.value == '') break;
if (this.selectedItem.name == this.name) break;
if (!this.selectedItem.isSelectable) break;
evt.preventDefault();
evt.stopImmediatePropagation();
this.select();
@ -729,6 +730,7 @@ export class AutoComplete {
case 'Tab': {
// pick the selected item to autocomplete
if (evt.ctrlKey || evt.altKey || evt.shiftKey || this.selectedItem.value == '') break;
if (!this.selectedItem.isSelectable) break;
evt.preventDefault();
evt.stopImmediatePropagation();
this.select();

View File

@ -23,6 +23,10 @@ export class AutoCompleteOption {
return this.name;
}
get isSelectable() {
return !this.valueProvider;
}
/**
* @param {string} name