-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #54 from bfanger/fix-portal-not-removed
fix: Remove element based on component lifecycle
- Loading branch information
Showing
3 changed files
with
54 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<script> | ||
import { fade } from "svelte/transition"; | ||
import Portal from "../src/Portal.svelte"; | ||
export let modalVisible = true; | ||
export let containerVisible = true; | ||
</script> | ||
|
||
{#if containerVisible} | ||
<div out:fade={{ duration: 100 }} on:outroend> | ||
{#if modalVisible} | ||
<Portal target="#modals"> | ||
<div id="modal" /> | ||
</Portal> | ||
{/if} | ||
</div> | ||
{/if} | ||
<div id="modals" /> |