nygardk / react-share

Social media share buttons and share counts for React
MIT License
2.6k stars 433 forks source link

Email Share is not working #419

Open hhimanshu opened 2 years ago

hhimanshu commented 2 years ago

As I click on the Email Icon for the demo at https://nygardk.github.io/react-share/, nothing happens. It appears to be a bug

heyalexchoi commented 2 years ago

not working for me either

EDIT: mailto: links don't work for me in general. Probably my chrome settings, or maybe even default chrome settings do not allow opening of mailto.

brad-sf commented 2 years ago

Works fine for me on Safari MacOS 11.6

leonchabbey commented 2 years ago

The demo works for me, but when i implemented it stopped working even though all other sharing services where working and were all doing the same thing --> onClick={() => myOwnHandleClick(serviceName)).

But i discovered that the email share button works a bit differently. It has its own onClick (which creates the necessary href to share with mailto:) and when you give it your own onClick it basically overrides the default onClick which does the magic.

So when implementing your own, you need to re-implement the href logic.

<EmailShareButton
  url={url}
  className={classes.icon}
  onClick={(_, link) => {
    window.location.href = link; // does the same as the default onClick
    yourOwnOnClick(...); // your function
  }}
>
  <EmailIcon size={ICON_SIZE} round />
</EmailShareButton>

It probably needs a refactor to do the window.location.href = ... even when specifying a new onClick. At least mention it in the README.

WisnuCakraa commented 2 years ago

Thanks, it's work

fvieira commented 1 year ago

This bit me too, the fact it works differently from the rest is unexpected and easy to go unnoticed.

gwhizoftv commented 1 year ago

I tried setting the Open Dialogue to true, but then an email message opens in the current tab as well as in the popup dialogue. This is on Chrome w/ MacOS Monterey. I only want the email to appear in the popup, not replace the current tab.