-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Site Editor: Fix the tooltip and shortcut for the global save button #48282
Conversation
@@ -0,0 +1,116 @@ | |||
/** |
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.
I didn't make any change to these three files, I just split the previous "index.js" file into three components in order to be able to insert them in different contexts. That way we can always make sure that the "save shortcut" works in all modes.
Size Change: +7 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
Flaky tests detected in 42d4c51. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4232870689
|
@@ -12,7 +12,7 @@ import { displayShortcut } from '@wordpress/keycodes'; | |||
*/ | |||
import { store as editSiteStore } from '../../store'; | |||
|
|||
export default function SaveButton() { | |||
export default function SaveButton( { showTooltip = true } ) { |
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.
Is there a reason for keeping the tooltip in the header Save
button when is disabled?
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.
yes, there is. In the post editor we want to force the tooltip to show regardless of whether there's a shortcut.
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.
Besides my small comment, this looks good. Thanks Riad!
I just cherry-picked this PR to the wp/6.2 branch to get it included in the next release: 464254d |
What?
This PR does two things:
Testing Instructions
1- Open the site editor
2- The save button should be disabled
3- hovering it shouldn't show any tooltip.
1- Open the site editor
2- Make some changes to anything
3- Make sure you're in browse mode
4- Ctrl+S should bring up the save modal