From 90ed086a8748926c6b9d6e9a5e7bb9f3005c169e Mon Sep 17 00:00:00 2001 From: Cheng-Hsuan Tsai Date: Mon, 8 Jun 2026 03:35:09 +0000 Subject: [PATCH] fix(aria/combobox): prevent re-dispatching keyboard event on control target change --- src/aria/private/combobox/combobox.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/aria/private/combobox/combobox.ts b/src/aria/private/combobox/combobox.ts index 74499e913419..e85c3b0d27fd 100644 --- a/src/aria/private/combobox/combobox.ts +++ b/src/aria/private/combobox/combobox.ts @@ -235,11 +235,12 @@ export class ComboboxPattern { // Reset isDeleting when the user navigates, so that the highlight effect can run again. this.isDeleting.set(false); - const popup = untracked(() => this.inputs.popup()); - const popupExpanded = untracked(() => this.isExpanded()); - if (popupExpanded) { - popup?.controlTarget()?.dispatchEvent(event); - } + untracked(() => { + const popup = this.inputs.popup(); + if (this.isExpanded()) { + popup?.controlTarget()?.dispatchEvent(event); + } + }); } /** Closes the popup when focus leaves the combobox and popup. */