Skip to content

Commit

Permalink
fix(autocomplete): solve input does not get cleared (#1151)
Browse files Browse the repository at this point in the history
  • Loading branch information
mlmoravek authored Dec 17, 2024
1 parent 123dc6f commit f0eccaf
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions packages/oruga/src/components/autocomplete/Autocomplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,11 @@ function setSelected(
selectedValue.value = option?.value;
emits("select", option?.value, event || new Event("select"));
if (option) {
if (props.clearOnSelect) inputValue.value = "";
else inputValue.value = option.label;
setHovered(undefined);
}
if (option) setHovered(undefined);
if (closeDropdown) nextTick(() => (isActive.value = false));
// update input value
inputValue.value = props.clearOnSelect ? "" : option?.label || "";
checkHtml5Validity();
}
Expand Down

0 comments on commit f0eccaf

Please sign in to comment.