-
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
Cover block: clear the min height field when aspect ratio is set #59191
Cover block: clear the min height field when aspect ratio is set #59191
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: +5 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
Flaky tests detected in a9e2847. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/7968765344
|
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 tweak @andrewserong 👍
This tests as advertised for me.
Initially, I thought it was a little weird not resetting the min-height attribute value as I thought the block support did that. Then I realised this uses its own ad hoc min-height solution.
Is this so the min-height can be reapplied when clearing an aspect ratio, or is it just because the Cover block supported min-height before the block support was available and was never switched over?
Do you think there's any plan/desire to switch the Cover block to use the block support?
Before | After |
---|---|
Screen.Recording.2024-02-21.at.11.42.38.am.mp4 |
Screen.Recording.2024-02-21.at.11.43.44.am.mp4 |
Thanks for the review @aaronrobertshaw! 🙇
It's primarily because the Cover block supported min-height before the block support was available, and this PR was the simplest way to fix the issue for 6.5, without having to add a But yes, I think ideally the Cover block would use the min height block support, in which case we wouldn't need this ad hoc fix for the ad hoc control. Perhaps something to consider for 6.6 could be to explore using the min height block support — I think the main thing that could make it a worthwhile effort would be that then folks could set a min height for the cover block in global styles. |
I just cherry-picked this PR to the cherry-pick-wp-6-5-beta-3 branch to get it included in the next release: 1fa7012 |
What?
Part of #58230 and follow-up to #56897
In the Cover block, when the aspect ratio is updated, clear out the value for the minimum height field.
Why?
When an aspect ratio is set, it will always override the minimum height value. To make it clearer that this is the case, display the minimum height field as empty. We don't need to "really" clear out the value itself in block attributes, as the minimum height value gets
unset
by the aspect ratio rules.How?
In the Cover block, pass in an empty string to the Cover block's minimum height input field if an aspect ratio value is set.
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Before
2024-02-20.16.05.54.mp4
After
2024-02-20.15.59.56.mp4