Skip to content

Media: Do not overlap title overlay and caption - #13468

Open
yogeshbhutkar wants to merge 1 commit into
WordPress:trunkfrom
yogeshbhutkar:trac-66076/do-not-overlap-tile-and-caption
Open

Media: Do not overlap title overlay and caption#13468
yogeshbhutkar wants to merge 1 commit into
WordPress:trunkfrom
yogeshbhutkar:trac-66076/do-not-overlap-tile-and-caption

Conversation

@yogeshbhutkar

@yogeshbhutkar yogeshbhutkar commented Sep 10, 2026

Copy link
Copy Markdown

Trac ticket: https://core.trac.wordpress.org/ticket/66076

What, Why, and How?

In the Edit Gallery view 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 ::after on .attachment, absolutely positioned at bottom: 8px. This works elsewhere. However, on Edit 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, so bottom: calc(8px + 40px) fixes the overlap as a minor CSS change.

Screenshots

Before After
before-01 after-1
before-02 after-2

Use of AI Tools

AI assistance: Yes
Tool(s): Codex
Model(s): GPT-6 Astra
Used for: Debugging and checking out various potential solutions.

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The 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

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@yogeshbhutkar
yogeshbhutkar marked this pull request as ready for review September 10, 2026 05:38
@github-actions

Copy link
Copy Markdown

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 props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props yogeshbhutkar.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant