fix: Escape closes a menu on the first press again (#32799)

Opening a menu moves the focus to its first entry, and when that entry has a tooltip the tooltip showed and took the first Escape, so the menu stayed open until Escape was pressed a second time. The open menu now gets Escape before the tooltip does and closes on the first press, while Escape in a submenu still closes only the submenu and Escape on a tooltip in a dialog still only hides the tooltip.

Fixes #32798
This commit is contained in:
Classic298 2026-10-21 02:53:25 +02:00 • committed by GitHub
parent 243ef36c49
commit d5e27b559e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -383,6 +383,7 @@
if (closeOnSelect && !e.defaultPrevented) closeDropdown();
}}
on:pointerdown={(e) => e.stopPropagation()}
on:keydown={handleKeydown}
>
<slot name="content" />
</div>