Skip to content

Commit 1f68430

Browse files
authored
fix(Spline): Do not unnecessarily render mid/end markers. Fixes Firefox when used with ClipPath. (#474)
1 parent c5a8ab1 commit 1f68430

2 files changed

Lines changed: 19 additions & 10 deletions

File tree

.changeset/kind-jokes-laugh.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'layerchart': patch
3+
---
4+
5+
fix(Spline): Do not unnecessarily render mid/end markers. Fixes Firefox when used with ClipPath.

packages/layerchart/src/lib/components/Spline.svelte

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -303,19 +303,23 @@
303303
</slot>
304304

305305
<slot name="markerMid" id={markerMidId}>
306-
<Marker
307-
id={markerMidId}
308-
type={typeof markerMid === 'string' ? markerMid : undefined}
309-
{...typeof markerMid === 'object' ? markerMid : null}
310-
/>
306+
{#if markerMid}
307+
<Marker
308+
id={markerMidId}
309+
type={typeof markerMid === 'string' ? markerMid : undefined}
310+
{...typeof markerMid === 'object' ? markerMid : null}
311+
/>
312+
{/if}
311313
</slot>
312314

313315
<slot name="markerEnd" id={markerEndId}>
314-
<Marker
315-
id={markerEndId}
316-
type={typeof markerEnd === 'string' ? markerEnd : undefined}
317-
{...typeof markerEnd === 'object' ? markerEnd : null}
318-
/>
316+
{#if markerEnd}
317+
<Marker
318+
id={markerEndId}
319+
type={typeof markerEnd === 'string' ? markerEnd : undefined}
320+
{...typeof markerEnd === 'object' ? markerEnd : null}
321+
/>
322+
{/if}
319323
</slot>
320324

321325
{#if $$slots.start && $startPoint}

0 commit comments

Comments
 (0)