-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Snackbar: Add support to open links in new tab #69905
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
Snackbar: Add support to open links in new tab #69905
Conversation
snackbar
links in new tab
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
aa0c974
to
22afc75
Compare
The failing test appears unrelated to the changes introduced in this PR and passes locally. I believe it should pass upon re-running. |
8244804
to
6897766
Compare
41579bc
to
69b10da
Compare
Hi @Mamaduka, if you have some time, I'd really appreciate it if you could review this PR. Thanks in advance! |
69b10da
to
1f6bd33
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @yogeshbhutkar! The changes look good to me ✅
It would be nice to get a sanity check from @WordPress/gutenberg-components team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At a glance, code changes LGTM.
Not allowing onClick
ehrn url
is defined seems a bit arbitrary, but I guess not in the scope of this PR.
Thanks for the feedback, @ciampo! Let's merge this. We can leave |
Co-authored-by: yogeshbhutkar <yogeshbhutkar@git.wordpress.org> Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: ciampo <mciampini@git.wordpress.org> Co-authored-by: mtias <matveb@git.wordpress.org> Co-authored-by: swissspidy <swissspidy@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org>
What?
Closes #59139
This PR enhances the Snackbar component by adding support for opening links in a new tab. Accordingly, the View Post, View Site, and View Preview links have been updated to open in a new tab by default.
Why?
Opening these links (View Post, View Site, and View Preview) in a new tab improves the user experience by preserving the current editing context.
How?
Consumers can now pass an
openInNewTab
boolean property to an action item to open that specific item in a new browser tab.Testing Instructions
Post
.View Post
in the snackbar notification.Testing Instructions for Keyboard
Same.
Screencast
PR.mov