@dosgato/dialog 1.4.4 → 1.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Tooltip.svelte +3 -4
- package/package.json +1 -1
package/dist/Tooltip.svelte
CHANGED
|
@@ -13,7 +13,6 @@
|
|
|
13
13
|
|
|
14
14
|
const tooltipId = randomid()
|
|
15
15
|
const anchorName = `--tip-${tooltipId}`
|
|
16
|
-
let triggerEl: HTMLSpanElement
|
|
17
16
|
let slotwrapper: HTMLSpanElement
|
|
18
17
|
|
|
19
18
|
let hasFocusableChild = false
|
|
@@ -21,8 +20,8 @@
|
|
|
21
20
|
|
|
22
21
|
async function reactToTip (..._: any[]) {
|
|
23
22
|
await tick()
|
|
24
|
-
if (!
|
|
25
|
-
const focusable =
|
|
23
|
+
if (!slotwrapper) return
|
|
24
|
+
const focusable = slotwrapper.querySelector('a[href], button, input, select, textarea, [tabindex]')
|
|
26
25
|
if (focusable) {
|
|
27
26
|
hasFocusableChild = true
|
|
28
27
|
focusable.setAttribute('aria-describedby', tooltipId)
|
|
@@ -35,7 +34,7 @@
|
|
|
35
34
|
|
|
36
35
|
{#if tip}
|
|
37
36
|
<div class="tooltip-wrapper">
|
|
38
|
-
<span bind:this={slotwrapper} class="tooltip-slot"
|
|
37
|
+
<span bind:this={slotwrapper} class="tooltip-slot">
|
|
39
38
|
<slot />
|
|
40
39
|
{#if !hasFocusableChild}<ScreenReaderOnly>tooltip: {tip}</ScreenReaderOnly>{/if}
|
|
41
40
|
</span>
|
package/package.json
CHANGED