Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Autocomplete): blur search input after selecting values #324

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -110,7 +110,7 @@
const renderedOptions = ref<ComponentPublicInstance[]>([]);

const menuMinHeight = computed<number>(() => {
const renderedOptionsData = get(renderedOptions).slice(0, Math.min(5, get(renderedData).length));

Check warning on line 113 in src/components/forms/auto-complete/RuiAutoComplete.vue

View workflow job for this annotation

GitHub Actions / ci

'renderedData' was used before it was defined
return renderedOptionsData.reduce((currentValue, item) => currentValue + item.$el.offsetHeight, 0);
});

Expand Down Expand Up @@ -315,7 +315,7 @@
set(value, [val]);
}

if (!skipRefocused)
if (!skipRefocused && get(multiple))
set(searchInputFocused, true);
}

Expand Down Expand Up @@ -798,7 +798,7 @@
&.readonly {
@apply opacity-80 pointer-events-none cursor-default bg-gray-50;
}

Check warning on line 801 in src/components/forms/auto-complete/RuiAutoComplete.vue

View workflow job for this annotation

GitHub Actions / ci

File has too many lines (988). Maximum allowed is 800
&.outlined {
@apply border-none hover:border-none;

Expand Down
Loading