From 5bf5a314c414b96c656190719bd56acca10676f5 Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Wed, 1 Feb 2023 15:20:21 +0100 Subject: [PATCH] fix(CommandPalette): put back cursor on top only when query changes --- src/runtime/components/navigation/CommandPalette.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/runtime/components/navigation/CommandPalette.vue b/src/runtime/components/navigation/CommandPalette.vue index 6a6d2d45..2e07a37f 100644 --- a/src/runtime/components/navigation/CommandPalette.vue +++ b/src/runtime/components/navigation/CommandPalette.vue @@ -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