Skip to content

Administration: Fix responsive list table toggle-row button positioning - #12771

Open
itzmekhokan wants to merge 1 commit into
WordPress:trunkfrom
itzmekhokan:fix/list-table-toggle-row-primary-th
Open

Administration: Fix responsive list table toggle-row button positioning#12771
itzmekhokan wants to merge 1 commit into
WordPress:trunkfrom
itzmekhokan:fix/list-table-toggle-row-primary-th

Conversation

@itzmekhokan

@itzmekhokan itzmekhokan commented Jul 30, 2026

Copy link
Copy Markdown

[62838] / #32892 made the primary column a <th scope="row"> and the checkbox column a <td>, but two selectors in the @media screen and (max-width: 782px) block of wp-admin/css/list-tables.css still only match td.

As a result the primary cell never gets position: relative, so the absolutely positioned .toggle-row button resolves against #wpbody and every row's button stacks on the Help and Screen Options tabs (measured top: 56, left: 734 on edit.php at 782px). Clicking Help expands a row instead. On expand, the primary th also stays table-cell while the sibling tds collapse to 8px blocks.

This adds a th selector to both rules, scoped to tbody so thead/tfoot are untouched, and excludes .check-column from the .is-expanded rule so the checkbox cell stays table-cell.

To test: at a viewport of 782px or narrower, open Posts, Pages, Comments, Users or Media (list mode). Each row should have its own chevron at the right edge of the title cell, the Help and Screen Options tabs should work, and expanding a row should stack its columns full width with their labels.

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

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5
Used for: Reproducing the bug at the 782px breakpoint, tracing it to [62838], and drafting the CSS change. I reviewed the diff, directed the scoping decisions, and verified the behaviour in the browser across the affected screens.

[62838] moved `scope="row"` to the primary column, making it a `th`. Two
selectors in the max-width: 782px block still only matched `td`, so the
primary cell lost its positioning context and the absolutely positioned
`.toggle-row` button escaped to `#wpbody`, overlapping the Help and Screen
Options tabs and stealing their clicks. Expanded rows also failed to stack,
and the checkbox cell was incorrectly switched to `display: block`.

Follow-up to [62838].
Props khokansardar.
See #32892.
Fixes #65763.
Copilot AI review requested due to automatic review settings July 30, 2026 13:18
@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 khokansardar.

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes responsive (≤782px) list table row-toggle (“chevron”) behavior after the primary column switched from td to th scope="row", ensuring the toggle button positions within the correct cell and expanded rows stack correctly.

Changes:

  • Extend the responsive positioning-context rule to also match tbody th:not(.check-column) so .toggle-row’s absolute positioning resolves per-row.
  • Extend the responsive expanded-row stacking rule to include th and exclude .check-column, keeping the checkbox cell as table-cell while other cells become blocks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@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.

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.

2 participants