Skip to content

Commit

Permalink
fix(SelectCustom): improve creatable placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamincanac committed Jul 16, 2022
1 parent 5906ee9 commit d413cf7
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/runtime/components/forms/SelectCustom.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</li>
</ComboboxOption>

<ComboboxOption v-if="queryOption" v-slot="{ active, selected }" :value="queryOption" as="template">
<ComboboxOption v-if="creatable && queryOption && !filteredOptions.length" v-slot="{ active, selected }" :value="queryOption" as="template">
<li :class="resolveOptionClass({ active, selected })">
<div :class="listOptionContainerClass">
<slot name="option-create" :option="queryOption" :active="active" :selected="selected">
Expand All @@ -69,7 +69,7 @@
</div>
</li>
</ComboboxOption>
<p v-else-if="searchable && query" :class="listOptionEmptyClass">
<p v-else-if="searchable && query && !filteredOptions.length" :class="listOptionEmptyClass">
<slot name="option-empty" :query="query">
No results found for "{{ query }}".
</slot>
Expand Down Expand Up @@ -306,13 +306,6 @@ const filteredOptions = computed(() =>
)
const queryOption = computed(() => {
if (!props.creatable) {
return null
}
if (!query.value) {
return null
}
return query.value === '' ? null : { [props.textAttribute]: query.value }
})
Expand Down

0 comments on commit d413cf7

Please sign in to comment.