Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
fix(AutoComplete): select option on tab
Browse files Browse the repository at this point in the history
  • Loading branch information
lukicenturi authored and kelsos committed Jun 17, 2024
1 parent 6157ac9 commit 689ea01
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/forms/auto-complete/RuiAutoComplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,13 @@ function onEnter() {
}
}
function onTab(event: KeyboardEvent) {
if (get(isOpen) && get(filteredOptions).length > 0 && get(highlightedIndex) > -1 && !get(multiple)) {
applyHighlighted();
event.preventDefault();
}
}
function getListeners(on: Record<string, Function | undefined>, $listeners: Record<string, Function | Function[]>) {
const listenersFiltered = objectOmit($listeners, ['input']);
Expand Down Expand Up @@ -516,6 +523,7 @@ defineExpose({
@click="setInputFocus()"
@focus="setInputFocus()"
@keydown.enter="onEnter()"
@keydown.tab="onTab($event)"
@keydown.left="moveSelectedValueHighlight($event, false)"
@keydown.right="moveSelectedValueHighlight($event, true)"
@keydown.up.prevent="moveHighlight(true)"
Expand Down

0 comments on commit 689ea01

Please sign in to comment.