-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Replace FSE block save buttons with temporary fake setAttribute call #34350
Conversation
…to force editor dirty state
// The following is a temporary fix. Setting this fake attribute is used to flag | ||
// the content as dirty to editor and enable Update/Publish button. This should be | ||
// removed once updating of site options handled in core editor | ||
setAttributes( { updated: Date.now() } ); |
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.
It is interesting that this works to flag the editor state as dirty, even though the fse blocks do not have any attributes set and so this doesn't actually update any attribute data in the block content.
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 think it's ok to use this hack while we confirm if the Gutenberg behavior here is deliberate or not (paAmJe-tF-p2 #comment-1329).
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.
Wacky.
This PR does not affect the size of JS and CSS bundles shipped to the user's browser. Generated by performance advisor bot at iscalypsofastyet.com. |
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.
Nice! Much better UX now without the save buttons.
Everything worked as expected on my tests so
// The following is a temporary fix. Setting this fake attribute is used to flag | ||
// the content as dirty to editor and enable Update/Publish button. This should be | ||
// removed once updating of site options handled in core editor | ||
setAttributes( { updated: Date.now() } ); |
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 think it's ok to use this hack while we confirm if the Gutenberg behavior here is deliberate or not (paAmJe-tF-p2 #comment-1329).
Changes proposed in this Pull Request
Testing instructions
Fixes #34287