From 7e76cbc8a997aa6a2b4375fd8b90f4b26bc36b17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Malinowski?= <47485431+malinowskip@users.noreply.github.com> Date: Tue, 9 Nov 2021 23:52:40 +0100 Subject: [PATCH] fix(Tooltip): fix two way binding in cases where icon is in focus (#895) --- src/Tooltip/Tooltip.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Tooltip/Tooltip.svelte b/src/Tooltip/Tooltip.svelte index b206c869..590ac926 100644 --- a/src/Tooltip/Tooltip.svelte +++ b/src/Tooltip/Tooltip.svelte @@ -73,7 +73,7 @@ setContext("Tooltip", { tooltipOpen }); function onKeydown(e) { - if (e.key === "Escape") { + if (e.key === "Escape" || e.key === "Tab") { e.stopPropagation(); open = false; } else if (e.key === " " || e.key === "Enter") { @@ -206,7 +206,6 @@ aria-describedby="{tooltipId}" on:mousedown="{onMousedown}" on:focus="{onFocus}" - on:blur="{onBlur}" on:keydown="{onKeydown}" > @@ -241,6 +240,7 @@ class:bx--tooltip--align-center="{align === 'center'}" class:bx--tooltip--align-start="{align === 'start'}" class:bx--tooltip--align-end="{align === 'end'}" + on:keydown="{onKeydown}" >