Exit early from onClick handler when isButtonDisabled#12885
Merged
Conversation
isButtonDisabled)
4 tasks
youknowriad
approved these changes
Dec 17, 2018
Member
Author
|
thanks for the review... not sure why checks are failing here, @youknowriad they pass for me locally |
Contributor
|
The tests are broken across the repository (some weird docker failures), @gziolo is working on them, we should rebase once everything is on track again. |
Member
Author
👍 I'll wait for that then merge once I see tests passing. |
Member
|
You can rebase now. Travis is back to normal. |
e9df4f8 to
f417d52
Compare
youknowriad
pushed a commit
that referenced
this pull request
Jan 3, 2019
* disable onClick event when button is disabled * clean up unit tests after click handler change
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #11809
Alternate/replaces #11760
Return early from click action handling when button is disabled (
isButtonDisabledis true)Since #11543 the post publish/update button is no longer
disabledwhenisButtonDisabledis true (https://github.com/WordPress/gutenberg/pull/11543/files#diff-29409e4e3f779a199509ffadad068564L76) - insteadaria-diabledis set to true (https://github.com/WordPress/gutenberg/pull/11543/files#diff-29409e4e3f779a199509ffadad068564L76) which still allows the button itself to be clicked.This PR prevents the button from being clicked by returning early from the
onClickhandler, see @youknowriad's comment here: https://github.com/WordPress/gutenberg/pull/11760/files#r236177807How has this been tested?
Needs testing.
Types of changes
Add a check for
isButtonDisabledin theonClickhandler, exit early if true - preventing click action handling.Checklist: