From b13bb8e09ff48b07f300622b7db3df3a4d14ba41 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Mon, 17 Jan 2022 13:40:10 -0800 Subject: [PATCH] fix(tooltip): pressing "Escape" should break out of trap focus (#1015) Fixes #924 --- src/Tooltip/Tooltip.svelte | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Tooltip/Tooltip.svelte b/src/Tooltip/Tooltip.svelte index 0635c38c..b6191b6f 100644 --- a/src/Tooltip/Tooltip.svelte +++ b/src/Tooltip/Tooltip.svelte @@ -75,6 +75,7 @@ function onKeydown(e) { if (e.key === "Escape" || e.key === "Tab") { e.stopPropagation(); + if (e.key === "Escape") refIcon?.focus(); open = false; } else if (e.key === " " || e.key === "Enter") { e.stopPropagation();