Merge pull request #5327 from xyflow/fix/svelte-ssr-portals

Fix SSR and portals in Svelte Flow & update Astro Example
This commit is contained in:
Moritz Klack
2025-06-11 13:29:14 +02:00
committed by GitHub
19 changed files with 2117 additions and 1909 deletions
@@ -2,7 +2,7 @@
import { getContext } from 'svelte';
import { Position, getNodeToolbarTransform } from '@xyflow/system';
import { portal } from '$lib/actions/portal';
import { hideOnSSR, portal } from '$lib/actions/portal';
import { useStore } from '$lib/store';
import { useSvelteFlow } from '$lib/hooks/useSvelteFlow.svelte';
@@ -68,6 +68,7 @@
{#if store.domNode && isActive && toolbarNodes}
<div
use:portal={'root'}
style:display={hideOnSSR().value ? 'none' : undefined}
class="svelte-flow__node-toolbar"
data-id={toolbarNodes.reduce((acc, node) => `${acc}${node.id} `, '').trim()}
style:position="absolute"