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 @@