mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-15 10:21:05 +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 });
|
setContext("Tooltip", { tooltipOpen });
|
||||||
|
|
||||||
function onKeydown(e) {
|
function onKeydown(e) {
|
||||||
if (e.key === "Escape") {
|
if (e.key === "Escape" || e.key === "Tab") {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
open = false;
|
open = false;
|
||||||
} else if (e.key === " " || e.key === "Enter") {
|
} else if (e.key === " " || e.key === "Enter") {
|
||||||
|
@ -206,7 +206,6 @@
|
||||||
aria-describedby="{tooltipId}"
|
aria-describedby="{tooltipId}"
|
||||||
on:mousedown="{onMousedown}"
|
on:mousedown="{onMousedown}"
|
||||||
on:focus="{onFocus}"
|
on:focus="{onFocus}"
|
||||||
on:blur="{onBlur}"
|
|
||||||
on:keydown="{onKeydown}"
|
on:keydown="{onKeydown}"
|
||||||
>
|
>
|
||||||
<slot name="icon">
|
<slot name="icon">
|
||||||
|
@ -241,6 +240,7 @@
|
||||||
class:bx--tooltip--align-center="{align === 'center'}"
|
class:bx--tooltip--align-center="{align === 'center'}"
|
||||||
class:bx--tooltip--align-start="{align === 'start'}"
|
class:bx--tooltip--align-start="{align === 'start'}"
|
||||||
class:bx--tooltip--align-end="{align === 'end'}"
|
class:bx--tooltip--align-end="{align === 'end'}"
|
||||||
|
on:keydown="{onKeydown}"
|
||||||
>
|
>
|
||||||
<span class:bx--tooltip__caret="{true}"></span>
|
<span class:bx--tooltip__caret="{true}"></span>
|
||||||
<div
|
<div
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue