refactor(svelte): prevent jumping nodes

This commit is contained in:
moklick
2023-10-23 16:00:20 +02:00
parent d1589bac17
commit f2b36f2d33
3 changed files with 6 additions and 2 deletions
@@ -39,6 +39,7 @@
export let targetPosition: NodeWrapperProps['targetPosition'] = undefined;
export let zIndex: NodeWrapperProps['zIndex'];
export let dragHandle: NodeWrapperProps['dragHandle'] = undefined;
export let initialized: NodeWrapperProps['initialized'] = false;
let className: string = '';
export { className as class };
@@ -159,6 +160,7 @@
style:transform="translate({positionOrigin?.x ?? 0}px, {positionOrigin?.y ?? 0}px)"
style:width={node.size?.width && `${node.size?.width}px`}
style:height={node.size?.height && `${node.size?.height}px`}
style:visibility={initialized ? 'visible' : 'hidden'}
{style}
on:click={onSelectNodeHandler}
on:mouseenter={(event) => dispatch('nodemouseenter', { node, event })}
@@ -27,4 +27,5 @@ export type NodeWrapperProps = Pick<
isParent?: boolean;
zIndex: number;
node: Node;
initialized: boolean;
};