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

chore: Improve undo/redo no-op #11428

Merged
merged 2 commits into from
Nov 8, 2018
Merged

Conversation

tofumatt
Copy link
Member

@tofumatt tofumatt commented Nov 2, 2018

A small tweak to how we manage the disabled/onClick nature of the undo/redo buttons.

See: #11379 (comment)

Copy link
Member

@jorgefilipecosta jorgefilipecosta left a 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(),
Copy link
Member

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,?

Copy link
Member Author

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.

Copy link
Member Author

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(),
Copy link
Member

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.

@tofumatt tofumatt added this to the 4.3 milestone Nov 8, 2018
@tofumatt tofumatt merged commit 4e9d9b3 into master Nov 8, 2018
@tofumatt tofumatt deleted the fix/onclick-for-disabled-undo-redo branch November 8, 2018 03:46
daniloercoli added a commit that referenced this pull request Nov 8, 2018
…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)
@mtias mtias added the [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). label Nov 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants