Skip to content

Commit

Permalink
fix(Autocomplete): fix focus in autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
lukicenturi committed Dec 25, 2024
1 parent 4c23309 commit 94fde26
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/forms/auto-complete/RuiAutoComplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ const menuRef = ref();
const menuWrapperRef = ref();
const { focused: activatorFocusedWithin } = useFocusWithin(activator);
const { focused: activatorFocused } = useFocus(activator);
const { focused: menuWrapperFocusedWithin } = useFocusWithin(menuWrapperRef);
const anyFocused = logicOr(activatorFocusedWithin, menuWrapperFocusedWithin);
const debouncedAnyFocused = refDebounced(anyFocused, 100);
Expand Down Expand Up @@ -306,7 +307,7 @@ async function setValue(val: TItem, index?: number, skipRefocused = false): Prom
else {
await nextTick(() => {
set(isOpen, false);
set(searchInputFocused, false);
set(activatorFocused, true);
});
if (get(shouldApplyValueAsSearch))
updateInternalSearch(getText(val));
Expand Down Expand Up @@ -658,6 +659,7 @@ defineExpose({
variant="text"
icon
size="sm"
tabindex="-1"
color="error"
class="group-hover:!visible"
:class="[$style.clear, anyFocused && '!visible', {
Expand Down

0 comments on commit 94fde26

Please sign in to comment.