Administration: Fix responsive list table toggle-row button positioning - #12771
Administration: Fix responsive list table toggle-row button positioning#12771itzmekhokan wants to merge 1 commit into
Conversation
[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.
|
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. |
There was a problem hiding this comment.
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
thand exclude.check-column, keeping the checkbox cell astable-cellwhile other cells become blocks.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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. |
[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 ofwp-admin/css/list-tables.cssstill only matchtd.As a result the primary cell never gets
position: relative, so the absolutely positioned.toggle-rowbutton resolves against#wpbodyand every row's button stacks on the Help and Screen Options tabs (measuredtop: 56, left: 734onedit.phpat 782px). Clicking Help expands a row instead. On expand, the primarythalso staystable-cellwhile the siblingtds collapse to 8px blocks.This adds a
thselector to both rules, scoped totbodysothead/tfootare untouched, and excludes.check-columnfrom the.is-expandedrule so the checkbox cell staystable-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.