From c42e450a4b91fbb8f6c6a4a5c0b92a7e245b5390 Mon Sep 17 00:00:00 2001 From: adrianschmidt-bot Date: Tue, 10 Feb 2026 12:05:51 +0100 Subject: [PATCH 1/2] fix(picker): prevent clearing input when chip menu opens When a chip inside the picker has a menu (actions), clicking the menu button would cause the picker to lose focus and clear its input field. This happened because focus moved to the menu's portal, which is outside the picker's DOM tree. The fix checks if any chip menu is currently open before deciding to clear the input field on blur. If a menu is open, we assume focus moved to the menu and don't clear. fix: #3676 --- src/components/picker/picker.tsx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/components/picker/picker.tsx b/src/components/picker/picker.tsx index 1efed84817..f4bfdcced9 100644 --- a/src/components/picker/picker.tsx +++ b/src/components/picker/picker.tsx @@ -547,9 +547,35 @@ export class Picker { return; } + // Don't clear if a chip's menu is open - focus moved to the menu's portal + if (this.hasOpenChipMenu()) { + return; + } + this.clearInputField(); } + private hasOpenChipMenu(): boolean { + if (!this.chipSet) { + return false; + } + + // Query for any open menus inside the chips + const chips = this.chipSet.shadowRoot?.querySelectorAll('limel-chip'); + if (!chips) { + return false; + } + + for (const chip of chips) { + const menu = chip.shadowRoot?.querySelector('limel-menu[open]'); + if (menu) { + return true; + } + } + + return false; + } + /** * Input handler for the input field * From eb4f20e8d01a7a51d29498e7bbc2888085fa6627 Mon Sep 17 00:00:00 2001 From: adrianschmidt-bot Date: Tue, 10 Feb 2026 16:40:32 +0100 Subject: [PATCH 2/2] fixup! fix(picker): prevent clearing input when chip menu opens --- src/components/picker/picker.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/picker/picker.tsx b/src/components/picker/picker.tsx index f4bfdcced9..9d9131fa9c 100644 --- a/src/components/picker/picker.tsx +++ b/src/components/picker/picker.tsx @@ -567,8 +567,13 @@ export class Picker { } for (const chip of chips) { - const menu = chip.shadowRoot?.querySelector('limel-menu[open]'); - if (menu) { + // Check the `open` property directly rather than using an attribute + // selector, because Stencil batches attribute reflection and + // the [open] attribute may not be on the DOM yet + const menu = chip.shadowRoot?.querySelector( + 'limel-menu' + ) as HTMLLimelMenuElement; + if (menu?.open) { return true; } }