mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 18:31:06 +00:00
fix(Tooltip): fix two way binding in cases where icon is in focus (#895)
This commit is contained in:
parent
81daaab1ff
commit
7e76cbc8a9
1 changed files with 2 additions and 2 deletions
|
@ -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}"
|
||||
>
|
||||
<slot name="icon">
|
||||
|
@ -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}"
|
||||
>
|
||||
<span class:bx--tooltip__caret="{true}"></span>
|
||||
<div
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue