fix(CommandPalette): put back cursor on top only when query changes

This commit is contained in:
Benjamin Canac
2023-02-01 15:20:21 +01:00
parent 3558eb1a4f
commit 5bf5a314c4

View File

@@ -183,7 +183,7 @@ const groups = computed(() => map(groupBy(results.value, command => command.item
} as Group
}))
watch(groups, () => {
watch(query, () => {
// Select first item on search changes
setTimeout(() => {
// https://github.com/tailwindlabs/headlessui/blob/6fa6074cd5d3a96f78a2d965392aa44101f5eede/packages/%40headlessui-vue/src/components/combobox/combobox.ts#L804