Skip to content

Commit

Permalink
fix: #187 remove non-unique ids from path and polygon
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed Nov 7, 2022
1 parent effeff0 commit c141f69
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/lib/components/Icon.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
<slot>
{#if self}
{#if self.paths}
{#each self.paths as path, i}
<Path id="{i}" data="{path}"/>
{#each self.paths as path}
<Path data="{path}"/>
{/each}
{/if}
{#if self.polygons}
{#each self.polygons as polygon, i}
<Polygon id="{i}" data="{polygon}"/>
{#each self.polygons as polygon}
<Polygon data="{polygon}"/>
{/each}
{/if}
{#if self.raw}
Expand Down
3 changes: 1 addition & 2 deletions src/lib/components/svg/Path.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<path id="path-{id}" {...data} />
<path {...data} />

<script lang="ts">
export let id: number;
export let data = {};
</script>
3 changes: 1 addition & 2 deletions src/lib/components/svg/Polygon.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<polygon id="polygon-{id}" {...data} />
<polygon {...data} />

<script lang="ts">
export let id: number;
export let data = {};
</script>

0 comments on commit c141f69

Please sign in to comment.