react-share icon indicating copy to clipboard operation
react-share copied to clipboard

Email Share is not working

Open hhimanshu opened this issue 4 years ago • 6 comments

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

hhimanshu avatar Oct 21 '21 20:10 hhimanshu

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.

heyalexchoi avatar Nov 06 '21 03:11 heyalexchoi

Works fine for me on Safari MacOS 11.6

bradfloodx avatar Dec 10 '21 02:12 bradfloodx

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.

leonchabbey avatar Dec 16 '21 13:12 leonchabbey

Thanks, it's work

WisnuCakraa avatar May 24 '22 04:05 WisnuCakraa

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

fvieira avatar Dec 30 '22 21:12 fvieira

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.

gwhizoftv avatar Mar 08 '23 20:03 gwhizoftv