pinterest / widgets

JavaScript widgets, including the Pin It button.
Other
211 stars 88 forks source link

Arbitrary button node structure (deeper than 1 level) #111

Open max-morawski-photo opened 1 year ago

max-morawski-photo commented 1 year ago

Simple change to enable share buttons with a structure deeper than 1 level currently supported. My use case is:

<a data-pin-do="buttonBookmark" data-pin-custom="true" ..>
  <div ..>
    <svg ..>
      ..
    </svg>
  </div>
</a>

In this case, click events go to the node and the stock Pinterest code does not work as expected.

kentbrew commented 1 year ago

Hi, sorry for dead air here. I'm no longer at Pinterest and (since I was the only one monitoring this repo) I doubt a reply will be forthcoming. Your change seems reasonable to me, although I would probably recommend a <span> and not a <div> inside the link, in case we're on an elderly page that needs to pass W3C validation.