fix(svelte): handle interactionWidth closes #3558
This commit is contained in:
@@ -17,6 +17,9 @@
|
|||||||
export let interactionWidth: $$Props['interactionWidth'] = 20;
|
export let interactionWidth: $$Props['interactionWidth'] = 20;
|
||||||
let className: $$Props['class'] = undefined;
|
let className: $$Props['class'] = undefined;
|
||||||
export { className as class };
|
export { className as class };
|
||||||
|
|
||||||
|
// @todo, why is interactionWidth undefined after first re-render?
|
||||||
|
let interactionWidthValue = interactionWidth === undefined ? 20 : interactionWidth;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<path
|
<path
|
||||||
@@ -29,11 +32,11 @@
|
|||||||
{style}
|
{style}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{#if interactionWidth}
|
{#if interactionWidthValue}
|
||||||
<path
|
<path
|
||||||
d={path}
|
d={path}
|
||||||
stroke-opacity={0}
|
stroke-opacity={0}
|
||||||
stroke-width={interactionWidth}
|
stroke-width={interactionWidthValue}
|
||||||
fill="none"
|
fill="none"
|
||||||
class="svelte-flow__edge-interaction"
|
class="svelte-flow__edge-interaction"
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -35,6 +35,8 @@
|
|||||||
export let sourcePosition: $$Props['sourcePosition'];
|
export let sourcePosition: $$Props['sourcePosition'];
|
||||||
export let targetPosition: $$Props['targetPosition'];
|
export let targetPosition: $$Props['targetPosition'];
|
||||||
export let ariaLabel: $$Props['ariaLabel'] = undefined;
|
export let ariaLabel: $$Props['ariaLabel'] = undefined;
|
||||||
|
export let interactionWidth: $$Props['interactionWidth'] = undefined;
|
||||||
|
|
||||||
// @ todo: support edge updates
|
// @ todo: support edge updates
|
||||||
let className: string = '';
|
let className: string = '';
|
||||||
export { className as class };
|
export { className as class };
|
||||||
@@ -104,6 +106,7 @@
|
|||||||
{labelStyle}
|
{labelStyle}
|
||||||
{data}
|
{data}
|
||||||
{style}
|
{style}
|
||||||
|
{interactionWidth}
|
||||||
sourceHandleId={sourceHandle}
|
sourceHandleId={sourceHandle}
|
||||||
targetHandleId={targetHandle}
|
targetHandleId={targetHandle}
|
||||||
markerStart={markerStartUrl}
|
markerStart={markerStartUrl}
|
||||||
|
|||||||
@@ -51,6 +51,7 @@
|
|||||||
sourcePosition={edge.sourcePosition}
|
sourcePosition={edge.sourcePosition}
|
||||||
targetPosition={edge.targetPosition}
|
targetPosition={edge.targetPosition}
|
||||||
ariaLabel={edge.ariaLabel}
|
ariaLabel={edge.ariaLabel}
|
||||||
|
interactionWidth={edge.interactionWidth}
|
||||||
class={edge.class}
|
class={edge.class}
|
||||||
type={edgeType}
|
type={edgeType}
|
||||||
{selectable}
|
{selectable}
|
||||||
|
|||||||
Reference in New Issue
Block a user