Skip to content

Commit

Permalink
fix(Autocomplete): blur search input after selecting values
Browse files Browse the repository at this point in the history
  • Loading branch information
lukicenturi authored and kelsos committed Jan 3, 2025
1 parent d30a9a2 commit fd6d1f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/components/forms/auto-complete/RuiAutoComplete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ describe('autocomplete', () => {
(wrapper.find('input').element as HTMLInputElement).blur();
await nextTick();
await vi.delay(100);
expect(document.activeElement).toBe(document.body);
expect((wrapper.find('input').element as HTMLInputElement).value).toBe('');

// doesn't break when use chips
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/auto-complete/RuiAutoComplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ async function setValue(val: TItem, index?: number, skipRefocused = false): Prom
set(value, [val]);
}
if (!skipRefocused)
if (!skipRefocused && get(multiple))
set(searchInputFocused, true);
}
Expand Down

0 comments on commit fd6d1f6

Please sign in to comment.