AI Disclosure
AI was used to update the MR.
Problem:
Default admin duplicates the header of the table and then uses JS to sticky it at the top of the page. This was necessary from ye ol' IE days, where we did not have tools like position: sticky. Note that Claro was modernized and no longer does this, yet default_admin was mostly derived from Gin, and still has the old method. which leads to problems such as focus order, etc.
Focus order issue
In the Default Admin theme, the keyboard navigation focus order in table headers is incorrect. This mirrors a bug identified in the Gin admin theme #3506338: Tabbing order in the table header is off.
When tabbing through a table (such as admin/content), the user is forced to cycle through the header columns twice. This appears to be caused by the theme rendering both a sticky and a regular table header, with both sets of elements remaining in the tab order. This results in a "lap of honor" where the focus circles back to the start of the header before finally moving into the table body.
Proposed Resolution:
We should remove the code that duplicates the table header and implement position: sticky, which replicates the current Claro behavior.
Steps to reproduce:
- Navigate to a standard administrative table, such as admin/content.
- Use the Tab key (or VO-arrow right in VoiceOver) to move through the table header.
- Observe that after reaching the final column (e.g., "Updated"), the focus returns to the first column header instead of moving to the first row of data.

Issue fork drupal-3583518
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
kentr commentedComment #3
kentr commentedThe issue summary of #3582351: [Meta] Clean up CSS within Admin theme has an item for completely removing the extra header.
Comment #4
mherchelNote here, we need to remove the duplicate sticky table, which was added back when properties such as
positition: stickydid not exist or work correctly.Removing this functionality, and setting
position: stickyshould 1) fix the accessibility issue here, and 2) remove lots of unneeded complexity.Comment #5
mherchelComment #7
mherchelComment #8
mortona2k commentedSticky table headers are causing this issue in Default Admin: #3641375: Sticky table header covers caption
They are positioned wrong on mobile:
__
Position: sticky doesn't work inside a horizontal scroll container, so javascript is still needed.
Claro works around this by breaking the layout:
__
core/misc/tableheader.js has been removed.
Default Admin still overrides the file: https://git.drupalcode.org/project/drupal/-/blob/main/core/themes/defaul...
__
Lastly, the scroll container has a negative top margin and overlaps with anything above it. I'm not sure if this is a direct cause of the current sticky implementation, or something that might be reworked along with it.
This causing an issue in the Audit Files module: https://git.drupalcode.org/project/auditfiles/-/work_items/3418734
Comment #9
mortona2k commentedMR !17498 fixed the caption overlap, but the sticky headers were hidden by the navigation top bar.
I used claude to fix the issues above. Verbose comments left in for review, but can be removed before merging.
A new js script is added to check if the table scrolls horizontally and handles the sticky position.
We can't have sticky headers and scrolling tables with css alone.
If the table does not scroll, it gets .is-sticky-native and the positioning js does not apply.
When javascript is disabled, sticky headers don't work to preserve horizontal scrolling.