Skip to content

Commit 1c47061

Browse files
committed
fix(aria/combobox): prevent re-dispatching keyboard event on control target change (#33362)
(cherry picked from commit 40b63f3)
1 parent 6f55ea0 commit 1c47061

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/aria/private/combobox/combobox.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -235,11 +235,12 @@ export class ComboboxPattern {
235235
// Reset isDeleting when the user navigates, so that the highlight effect can run again.
236236
this.isDeleting.set(false);
237237

238-
const popup = untracked(() => this.inputs.popup());
239-
const popupExpanded = untracked(() => this.isExpanded());
240-
if (popupExpanded) {
241-
popup?.controlTarget()?.dispatchEvent(event);
242-
}
238+
untracked(() => {
239+
const popup = this.inputs.popup();
240+
if (this.isExpanded()) {
241+
popup?.controlTarget()?.dispatchEvent(event);
242+
}
243+
});
243244
}
244245

245246
/** Closes the popup when focus leaves the combobox and popup. */

0 commit comments

Comments
 (0)