From 07924048f94f88b727cd219b9805d1c0859ec73d Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Mon, 17 Jan 2022 13:32:08 -0800 Subject: [PATCH] fix(tooltip): pressing "Escape" should break out of trap focus 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();