fix(svelte): re-observe nodes when not initialized close #4160

This commit is contained in:
moklick
2024-04-16 10:56:53 +02:00
parent 53ea72e85b
commit e2ff509f3d
2 changed files with 5 additions and 1 deletions

View File

@@ -1,5 +1,9 @@
# @xyflow/svelte
## 0.0.41
- fix: re-observe nodes when not initialized
## 0.0.40
- add `orientation` ('horizontal' or 'vertical'), `style` and `class` prop for `Controls` component

View File

@@ -121,7 +121,7 @@
setContext('svelteflow__node_connectable', connectableStore);
$: {
if (resizeObserver && nodeRef !== prevNodeRef) {
if (resizeObserver && (nodeRef !== prevNodeRef || !initialized)) {
prevNodeRef && resizeObserver.unobserve(prevNodeRef);
nodeRef && resizeObserver.observe(nodeRef);
prevNodeRef = nodeRef;