-
Notifications
You must be signed in to change notification settings - Fork 9
Closed
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed
Description
This is a slightly modified version of an example from the document.
<script lang="ts">
import { offset, flip, shift } from "svelte-floating-ui/dom";
import { createFloatingActions } from "svelte-floating-ui";
const [ floatingRef, floatingContent ] = createFloatingActions({
strategy: "absolute",
placement: "top",
middleware: [
offset(6),
flip(),
shift(),
],
onComputed() {
console.log('😡 onComputed!')
},
});
let showTooltip: boolean = false;
</script>
<div style="height: 2000px">
<button
on:mouseenter={() => showTooltip = true}
on:mouseleave={() => showTooltip = false}
use:floatingRef
>Hover me</button>
{#if showTooltip}
<div style="position:absolute" use:floatingContent>
Tooltip
</div>
{/if}
</div>Repeat hover to repeatedly create and destroy the DOM containing the use:floatingContent. Then onComputed is verbosely called depending on the number of times the DOM is regenerated.
Is it possible that when the DOM containing the use:floatingContent is destroyed, the floatingContent is not properly cleaned up after?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed