fix(ui): portal album menu and close previous overlays
This commit is contained in:
1 parent
8a570e7fd9
commit
b397555bdc
2 files changed
+50
-7
No files matched your search
@@ -0,0 +1,27 @@
|
||||
<script lang="ts">
|
||||
import { onMount } from 'svelte';
|
||||
|
||||
export let target: HTMLElement;
|
||||
|
||||
let container: HTMLDivElement | null = null;
|
||||
|
||||
onMount(() => {
|
||||
if (!container || !target) return;
|
||||
target.appendChild(container);
|
||||
return () => {
|
||||
if (container?.parentNode) {
|
||||
container.parentNode.removeChild(container);
|
||||
}
|
||||
};
|
||||
});
|
||||
</script>
|
||||
|
||||
<div bind:this={container} class="portal-root">
|
||||
<slot />
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.portal-root {
|
||||
display: contents;
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user