Skip to content

SVG icons with IDs do not work #514

Open
@macieklamberski

Description

@macieklamberski

Description

I'm using SVG icons inside <l-icon>. I have linear <linearGradient> with id="a" and I'm referencing this gradient to fill a circle. When I put the icon outside the map, gradient is nicely filling the circle. When I use same icon inside the map, gradient stops working.

The strange thing is that when I put the same icon inside the map and BEFORE the map, gradient appears in both icons. When I move icon AFTER the map, both icons do not have the gradient.

Looks to me as if this gradient with id="a" was not visible for SVG icon if its first occurence in DOM is inside the map.

I think it's related to this issue: #508 (comment).

Live Demo

https://codesandbox.io/s/hungry-bell-y2w1b

Steps to Reproduce

  1. Initially you see both icons have gradient.
  2. Remove <icon /> component from above the map to see that icon inside map does not have gradient.
  3. Put icon below the map to have the same result.

Expected Results

SVG icon inside the map should have linear gradient.

Actual Results

SVG icon only have gradient if there's the same icon before the map in DOM.

Browsers Affected

  • Chrome
  • Firefox
  • Edge
  • Safari 9
  • Safari 8
  • IE 11

Versions

  • Vue: v2.6.11
  • Vue2Leaflet: v2.4.2

Metadata

Metadata

Assignees

Labels

bugconfirmedIssue is accepted as either a bug or a valid enhancementhelp wanted

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions