Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): Open mailto link in new tab #7982

Merged

Conversation

jfrancos-mai
Copy link
Contributor

email

Description:

Some Apple/Chrome users have Chrome set to handle mailto links by opening them in a specific webmail client (e.g. gmail). In this situation, when DataHub's "email" link is clicked, the current DataHub page is replaced with a gmail-compose page, which then disappears once the message is sent.

The fix here is adding target="_blank" to the anchor tag. I tried out this change and verified that behavior is what we'd want for both situations:

  1. When Chrome is set to handle mailto links, they open in a new tab
  2. When that's not the case, an external client is opened as usual, without opening an extra tab

Other browsers:

To test this out:

  1. Open Apple mail settings and set "Default email reader" to Google Chrome
  2. Open up gmail in chrome, and click the double-diamonds on the right side of the address bar
  3. If the double diamonds don't appear, remove mail.google.com from chrome://settings/handlers and reload the gmail page

Checklist

  • The PR conforms to DataHub's Contributing Guideline (particularly Commit Message Format)
  • Links to related issues (if applicable)
  • Tests for the changes have been added/updated (if applicable)
  • Docs related to the changes have been added/updated (if applicable). If a new feature has been added a Usage Guide has been added for the same.
  • For any breaking change/potential downtime/deprecation/big changes an entry has been made in Updating DataHub

Description: 

Ticket: https://manifoldai.atlassian.net/browse/SCDM-332

Some Chrome users have Chrome set to handle `mailto` links by opening
them in a specific webmail client (e.g. gmail). In this situation, when
DataHub's "email" link is clicked, the current DataHub page is replaced
with a gmail-compose page.

The fix here is adding `target="_blank"` to the anchor tag. I tried out
this change and verified that behavior is what we'd want for both
situations:
1. When Chrome is set to handle `mailto` links, they open in a new tab
2. When that's not the case, an external client is opened as usual,
without opening an extra tab

Other browsers:
- Safari has this capability but only with installing an extension. I
did not test this.
- [Firefox ignores `target="_blank"` for `mailto`
links.](https://bugzilla.mozilla.org/show_bug.cgi?id=646552) If we'd
like to fix this for Firefox, we can do it in javascript with
`window.open` but that's a rabbit hole. I don't think we should worry
about it, [considering its relative low
usage](https://en.wikipedia.org/wiki/Usage_share_of_web_browsers#toc-Summary_tables-sublist),
but happy to work on it if we think it's necessary.
@github-actions github-actions bot added the product PR or Issue related to the DataHub UI/UX label May 5, 2023
Copy link
Collaborator

@chriscollins3456 chriscollins3456 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

amazing thank you!

@chriscollins3456 chriscollins3456 merged commit 2c4a59b into datahub-project:master May 24, 2023
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product PR or Issue related to the DataHub UI/UX
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants