osompress / simple-social-icons

Plugin: Simple Social Icons
62 stars 33 forks source link

Equal identifiers when widget is used multiple times on one page #72

Closed NormanHoehne closed 5 years ago

NormanHoehne commented 6 years ago

If one page carries two simple social icon widgets with the same social media icon, e.g.:

  1. Facebook Icon in the Navigation Bar
  2. Facebook Icon in the Footer Section

The page will have four elements with the same id:

dreamwhisper commented 5 years ago

This should be resolved in the develop branch for next release.

NormanHoehne commented 5 years ago

✔️ The mentioned issue "2x the same title id" is now resolved with version 3.0.0 ❌ The mentioned issue "2x the same svg id" still remains on version 3.0.0 - I'm not sure if this is valid Markup, can someone double check that?

nickcernis commented 5 years ago

Thanks for testing this, @NormanHoehne!

I see the same duplicate ID reused in the SVG markup itself, but it doesn't generate any validation errors for me. The way it's loaded via the <use> element effectively places it in a separate DOM tree:

The effect is the same as if the nodes were deeply cloned into a non-exposed DOM… — https://developer.mozilla.org/en-US/docs/Web/SVG/Element/use

Chrome represents this as descending from the shadow-root:

screen shot on 2018-10-11 at 12 39 12

So I expect that particular duplicated ID to be safe to ignore here.

NormanHoehne commented 5 years ago

Thank you for the clarification @nickcernis, I can live with that! :) 👍