-
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
Improve block filters #48420
Improve block filters #48420
Conversation
Size Change: +132 B (0%) Total Size: 1.33 MB
ℹ️ View Unchanged
|
f260e28
to
b812d46
Compare
// If an alignment is not assigned, there's no need to go through the | ||
// effort to validate or assign its value. | ||
if ( align === undefined ) { | ||
if ( props.attributes.align === undefined ) { |
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 problem with the change here is that the React tree of elements is different, meaning when the value of the "align" attribute changes, it will cause a "remount" of the whole block which we know can create unexpected bugs.
Flaky tests detected in f260e28359ada6e35cb577d9eeb6cdcbb1012723. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4263483506
|
}, | ||
layoutClasses | ||
); | ||
if ( ! hasLayoutBlockSupport ) { |
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.
Theorically, it's very hard for a block to switch between "has layout support" to "no layout support" but you also suffer the "remount" problem here if someone updates the block settings for instance by dispatching an action.
flex-grow: 1; | ||
}`; | ||
if ( ! hasChildLayout ) { | ||
return <BlockListBlock { ...props } />; |
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 as above here.
What?
Ok, there are a couple of problems with
trunk
.Why?
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast