diff --git a/docs/src/pages/components/Tooltip.svx b/docs/src/pages/components/Tooltip.svx
index a9deb31b..f4f6d538 100644
--- a/docs/src/pages/components/Tooltip.svx
+++ b/docs/src/pages/components/Tooltip.svx
@@ -20,6 +20,10 @@
+### Reactive example
+
+
+
### Directions
Top
@@ -60,4 +64,12 @@
Resources are provisioned based on your account's organization.
+
+
+### Hidden icon
+
+
+
+ Resources are provisioned based on your account's organization.
+
\ No newline at end of file
diff --git a/docs/src/pages/framed/Tooltip/TooltipReactive.svelte b/docs/src/pages/framed/Tooltip/TooltipReactive.svelte
new file mode 100644
index 00000000..8d131ae1
--- /dev/null
+++ b/docs/src/pages/framed/Tooltip/TooltipReactive.svelte
@@ -0,0 +1,23 @@
+
+
+
+
+
+ Resources are provisioned based on your account's organization.
+
+
+
+
+
+
+Open: {open}
diff --git a/src/Tooltip/Tooltip.svelte b/src/Tooltip/Tooltip.svelte
index ca6076fa..3f2bd110 100644
--- a/src/Tooltip/Tooltip.svelte
+++ b/src/Tooltip/Tooltip.svelte
@@ -68,8 +68,6 @@
const dispatch = createEventDispatcher();
- let programmatic = true;
-
function onKeydown(e) {
if (e.key === "Escape") {
e.stopPropagation();
@@ -88,15 +86,9 @@
}
function openMenu() {
- programmatic = false;
open = true;
}
- function closeMenu() {
- programmatic = false;
- open = false;
- }
-
afterUpdate(() => {
if (open) {
const button = ref.getBoundingClientRect();
@@ -167,8 +159,14 @@
{
+ if (open && target.contains(refTooltip)) {
+ if (refIcon) {
+ refIcon.focus();
+ } else if (ref) {
+ ref.focus();
+ }
+
open = false;
}
}}" />
@@ -206,7 +204,6 @@