-
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
chore: Improve undo/redo no-op #11428
Conversation
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.
The change looks good to me and tests correctly as expected.
} | ||
}, | ||
withDispatch( ( dispatch ) => ( { | ||
redo: () => dispatch( 'core/editor' ).redo(), |
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.
nitpick: can we simplify to redo: dispatch( 'core/editor' ).redo,
?
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.
It was like that before I made the change, though I'm not immediately sure why. I'll give it a shot.
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.
Tried it and it worked, cool 👍
} | ||
}, | ||
withDispatch( ( dispatch ) => ( { | ||
undo: () => dispatch( 'core/editor' ).undo(), |
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.
Same situation as the redo case.
…rnmobile/fix-merge-content-not-refreshed-UI * 'master' of https://github.com/WordPress/gutenberg: Add missing tests for Format API code (#11562) chore: Improve undo/redo no-op (#11428) Fix: Contrast checker: Consider fontSize large when size >= 24px instead of >= 18px (#9268)
A small tweak to how we manage the disabled/
onClick
nature of the undo/redo buttons.See: #11379 (comment)