Fix Media & Text “crop image to fill” to work with linked media #27211
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issues
Using a Media & Text block with both linked media and the ”Crop image to fill entire column” results in a styling failure. The
img
element is not hidden as intended (to allow the “crop” to be of the background image).Variations of the breakage can be seen in the following issues: #21399; https://core.trac.wordpress.org/ticket/49890
Additionally, I noticed that if the media is switched to a video while the ”Crop image to fill entire column” option is on then the Focal Point Picker is left in the UI which is possibly confusing as it has no effect on video media.
A screen recording to demonstrate leftover focal point picker
Changes
To address the issues
img
element to be descendent instead of child combinator.a
to make the link cover the media area since the image is hidden.Tangential changes
figure
in the selectors for the media elementHow has this been tested?
Types of changes
Bug fix: #21399
Checklist: