Skip to content

Commit

Permalink
Work around action timing change in Svelte 5 by updating example to s…
Browse files Browse the repository at this point in the history
…pecific explicit `target: document.body`. Resolves #437
  • Loading branch information
techniq committed Jul 15, 2024
1 parent 645de6a commit f849427
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
<div class="relative">
<Toggle let:on={enabled} let:toggleOn let:toggleOff>
<Button on:click={toggleOn} class="border mt-4">Move to body</Button>
<div use:portal={enabled} class="portal-content">
<!-- Explicit "target: document.body" only needed because ".PortalTarget" exists other examples -->
<div use:portal={{ enabled, target: document.body }} class="portal-content">
<div>Portal content</div>
{#if enabled}
<Button on:click={toggleOff} class="border mt-4">Move back to parent</Button>
Expand Down

0 comments on commit f849427

Please sign in to comment.