-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Featured Image: fixed resetAll to return image resolution to default value #70514
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
Featured Image: fixed resetAll to return image resolution to default value #70514
Conversation
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
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. |
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 PR!
I think it's better to use undefined rather than the default media size slug, otherwise the attribute value won't disappear completely when you reset it:
<!-- wp:post-featured-image {"sizeSlug":"full"} /-->
If everything is reset, all attribute values should disappear and return to their initial state, as shown below.
<!-- wp:post-featured-image /-->
Thank you for your review. If press the rest button for Resolution only (not Reset all), should If select full in |
Set it to undefined when it matches feature-image-2.mp4 |
<!-- wp:post-featured-image {"sizeSlug":"full"} /-->
<!-- wp:post-featured-image /--> After some research, I found that these two HTMLs can have different results. See #70526 for more details.
In other words, this approach means that users will no longer be able to explicitly select the This may affect some themes, so we might want to explicitly apply Let me know what you think! |
Added defaults to options so that they can be reset to their initial values.😄 post-feature-image.mp4 |
c36631d
to
2d534c3
Compare
Sorry for bothering you. After some research, I found a similar discussion about the UI of the default options for the aspect ratio of the cover block. |
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.
LGTM! I think this approach is the best for now.
If a default option is added in the future, we may be able to reconsider the reset behavior.
What?
Similar #70398
Why?
Clicking Reset all doesn't reset the resolution to default.
Fixed it to go back to full resolution like in #70398
How?
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Before
before.mp4
After
after.mp4