console/frontend: fix styling of selected list entries

"ui-not-selected" was not working as expected, as it matched the "open"
state of the parent widget.
This commit is contained in:
Vincent Bernat
2025-05-19 00:14:01 +02:00
parent dd78410c75
commit 7ce10d5942

View File

@@ -65,17 +65,23 @@
:is="component.Option"
v-for="item in filteredItems"
:key="item.id"
v-slot="{ active, selected }"
:value="item"
as="template"
>
<li
class="relative inline-flex w-full cursor-default select-none py-2 pl-10 pr-2.5 text-sm hover:bg-gray-100 ui-active:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white ui-active:dark:bg-gray-600 ui-active:dark:bg-gray-600 ui-active:dark:text-white"
class="relative inline-flex w-full cursor-default select-none py-2 pl-10 pr-2.5 text-sm hover:bg-gray-100 dark:hover:bg-gray-600 dark:hover:text-white"
:class="{
'bg-gray-100 dark:bg-gray-600 dark:bg-gray-600 dark:text-white':
active,
}"
>
<span class="block w-full truncate">
<slot name="item" v-bind="item"></slot>
</span>
<span
class="absolute inset-y-0 left-0 flex items-center pl-2.5 text-blue-600 ui-not-selected:hidden dark:text-blue-500"
class="absolute inset-y-0 left-0 flex items-center pl-2.5 text-blue-600 dark:text-blue-500"
:class="{ hidden: !selected }"
>
<CheckIcon class="h-5 w-5" aria-hidden="true" />
</span>