Media: Do not overlap title overlay and caption - #13468
Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Trac ticket: https://core.trac.wordpress.org/ticket/66076
What, Why, and How?
In the
Edit Galleryview of the media modal, each image gets a filename overlay and an (intentional) caption input. The overlay shows up in other media views too, but the input is unique to this screen, and that’s where they overlap.The overlay is an
::afteron.attachment, absolutely positioned atbottom: 8px. This works elsewhere. However, onEdit Gallery, the caption field sits in that same bottom strip, so the overlay covers it.There are a few ways to fix this. We could move the overlay one level up in the DOM so the input is naturally accounted for, but that means changing the attachment template and checking every media modal view for regressions. A grid layout would also stack them cleanly. This PR instead keeps the current absolute positioning and raises bottom when the caption input is present. Attachment padding (
8px) and the input’s min-height (40px) are already hardcoded, sobottom: calc(8px + 40px)fixes the overlap as a minor CSS change.Screenshots
Use of AI Tools
AI assistance: Yes
Tool(s): Codex
Model(s): GPT-6 Astra
Used for: Debugging and checking out various potential solutions.