-
Notifications
You must be signed in to change notification settings - Fork 4.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
Fix resetting individual blocks to empty optional values for Pattern Overrides #59170
Conversation
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: +33 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
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 putting this PR together @kevin940726 👍
The change makes sense but following the test instructions I couldn't replicate the issue at all on trunk. Maybe I'm missing something?
I tried:
- Creating patterns via the post editor and the site editor's patterns page
- Starting with content in a paragraph and removing it as well as starting with empty paragraph
- With the paragraph being the root block of the pattern or an inner block
Here's some of what I saw on trunk:
Screen.Recording.2024-02-20.at.10.58.17.am.mp4
While testing I kept running into an issue where the rich text controls went missing. It looks like this occurs on trunk as well as this branch.
Steps to replicate:
- Add pattern with paragraph
- Select pattern block (not paragraph)
- Click into whitespace at the end of the paragraph
- Note missing controls.
Screen.Recording.2024-02-20.at.11.17.02.am.mp4
Same here, I also couldn't reproduce in I was also able to reproduce the issue with the disappearing block controls that @aaronrobertshaw spotted, but it was pretty hard to repro, I had to click right in that space just above the block. I also had issues with the sibling inserter showing and not going away when I did that, and it's not actually supposed to display above a selected block like that: |
Started looking into this one a little more. I think it's a block selection bug rather than anything related to patterns. I can reproduce it in a group block too:
|
I can replicate the same behaviour independent of patterns as Dan noted. This is what I saw: Screen.Recording.2024-02-20.at.5.37.01.pm.mp4 |
Oops! I think this only happens on optional attributes like I've updated the testing instructions to use the empty image block instead! Sorry for the confusion 🙇. |
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've updated the testing instructions to use the empty image block instead!
Thanks for that clarification.
Following the updated test instructions I could replicate the original issue i.e. being unable to reset the image block.
This PR does resolve that issue.
Before | After |
---|---|
Screen.Recording.2024-02-21.at.10.08.19.am.mp4 |
Screen.Recording.2024-02-21.at.10.10.51.am.mp4 |
While testing this I noticed another small issue that appears on both trunk and this PR, the position of the reset button in the toolbar changes position, from first to last, after resetting.
…#59170) Co-authored-by: kevin940726 <kevin940726@git.wordpress.org> Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org>
I just cherry-picked this PR to the cherry-pick-wp-6-5-beta-3 branch to get it included in the next release: 36237f0 |
…#59170) Co-authored-by: kevin940726 <kevin940726@git.wordpress.org> Co-authored-by: aaronrobertshaw <aaronrobertshaw@git.wordpress.org> Co-authored-by: talldan <talldanwp@git.wordpress.org>
What?
Fix resetting individual blocks to empty optional values for Pattern Overrides.
Why?
A bug where clicking the reset button doesn't work.
How?
Reset existing attributes to undefined first.
Testing Instructions
Screenshots or screencast
N/A