fix: select component

This commit is contained in:
kur0nek-o
2024-02-21 17:20:57 +07:00
parent 00d03c1b7e
commit 7464cb6d1c
3 changed files with 76 additions and 36 deletions

View File

@ -76,19 +76,15 @@ const show = ref(false)
>
<ComboboxInput
class="w-full border-none py-2 pl-3 pr-10 bg-gray-200 text-sm leading-5 text-gray-900 focus:ring-0"
:placeholder="selected.name"
:displayValue="(item: any) => (show || open ? '' : item.name)"
@change="query = $event.target.value"
@click="show = true"
@blur="show = false"
defaultValue=""
/>
<ComboboxButton class="absolute inset-y-0 right-0 flex items-center pr-2">
<ChevronUpDownIcon class="h-5 w-5 text-gray-400" aria-hidden="true" />
</ComboboxButton>
</div>
<TransitionRoot
:show="show || open"
leave="transition ease-in duration-100"
leaveFrom="opacity-100"
leaveTo="opacity-0"