Block API: Fallback to all attributes when checking for unmodified block#73867
Block API: Fallback to all attributes when checking for unmodified block#73867
Conversation
| return ( | ||
| Object.keys( block.attributes[ key ]?.bindings ?? {} ) | ||
| .length > 0 | ||
| ); |
There was a problem hiding this comment.
I skipped on this idea originally, but it became an obvious choice when working on this fix. Otherwise, the fallback doesn't work.
|
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. |
|
Size Change: +21 B (0%) Total Size: 2.57 MB
ℹ️ View Unchanged
|
andrewserong
left a comment
There was a problem hiding this comment.
Thanks for the testing instructions, I could reproduce the issue in trunk by removing the content role from the content attribute in the paragraph block, and this PR fixes it up nicely 👍
Left a drive-by comment but it's not in any way significant so feel free to ignore.
LGTM!
|
Flaky tests detected in 7067c14. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/20087284123
|
…ock (#73867) Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: andrewserong <andrewserong@git.wordpress.org> Co-authored-by: albanyacademy <brumack@git.wordpress.org>
…ock (#73867) Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: andrewserong <andrewserong@git.wordpress.org> Co-authored-by: albanyacademy <brumack@git.wordpress.org>
|
This PR has been backported to the |
What?
Closes #73851
This is a follow-up to #70764 and #70897.
PR adds fallback logic to
isUnmodifiedBlockhelper to maintainn original behavior for blocks that haven't yet started using attribute roles.Why?
Attribute roles are relatively new, and not all blocks have adopted them. The editor should maintain the previous behavior for them - check for any attribute modification as a fallback.
Testing Instructions
Testing Instructions for Keyboard
Same.
Screencast