-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Block API: Fallback to all attributes when checking for unmodified block #73867
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
Conversation
| return ( | ||
| Object.keys( block.attributes[ key ]?.bindings ?? {} ) | ||
| .length > 0 | ||
| ); |
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
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