Skip to content

Commit

Permalink
fix: visibility of clearable with arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnCampionJr committed Nov 3, 2023
1 parent ec66e91 commit 9048ac3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion components/BaseAutocomplete.vue
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,11 @@ function key(item: T) {
</slot>
</div>
<button
v-if="props.clearable && vmodel && vmodel?.length > 0"
v-if="
props.clearable &&
((Array.isArray(vmodel) && vmodel?.length > 0) ||
(!Array.isArray(vmodel) && vmodel != null))
"
type="button"
tabindex="-1"
class="nui-autocomplete-clear"
Expand Down

0 comments on commit 9048ac3

Please sign in to comment.