From c5007622754d6e6f6c0deebd73db7913bf6eb9b8 Mon Sep 17 00:00:00 2001 From: Steffen Becker Date: Sun, 16 Aug 2026 03:04:43 +0200 Subject: [PATCH] fix: Escape closes the character and date/time pickers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both handled the key on the dropdown, but opening one leaves the focus on its trigger button, which sits outside it — so Escape never arrived and the popover stayed open. Both elements listen now. --- src/lib/components/DateTimePicker.svelte | 11 +++++------ src/lib/components/SpecialCharPicker.svelte | 11 +++++------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/lib/components/DateTimePicker.svelte b/src/lib/components/DateTimePicker.svelte index a82d577..cf11bea 100644 --- a/src/lib/components/DateTimePicker.svelte +++ b/src/lib/components/DateTimePicker.svelte @@ -61,11 +61,10 @@ open = false; } + // On both the trigger and the dropdown: opening leaves the focus on the trigger, + // which sits outside the dropdown and never delivers the key to it. function onKeydown(e: KeyboardEvent) { - if (e.key === 'Escape') { - open = false; - (e.currentTarget as HTMLElement).blur(); - } + if (e.key === 'Escape') open = false; } function dtPickerClickOutside(node: HTMLElement) { @@ -78,7 +77,7 @@
- {#if open} -