twbs / twbs/bootstrap

visually-hidden text in table shows body scrollbar in Chrome

Open
#41,554 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

accessibility confirmed css
Dominant language
MDX
Stars
175k
Forks
78.6k
Avg merge
7h 19m
Merged PRs (30d)
35

Description

Prerequisites
Describe the issue

I have a horizontally scrolled, wide table that contains visually-hidden text in the table head. This produces an unexpected body scrollbar in Chrome. Observation:

  • Does not occur in Firefox.
  • Does not occur when there is no visually-hidden text.
  • Does only occur when the visually-hidden text is in the last columns that exceed the scrolled wrapper width.
  • Does not occur when "position: fixed" is used for visually-hidden (but I guess this is not an option for a fix).

I don't know a workaround so far that doesn't have downsides for a11y.
Maybe this is a bug in Chrome itself.

Reduced test cases

See this reproducing example. Open in Chrome and reduce the window width (e.g. by dev tools) until a scroll bar appears for the body (ignore the table wrapper scrollbar, this is intended). Scrolling the body, you can see that the table wrapper does not exceed the expected width.

https://codepen.io/s4R8/full/myJGwrY

What operating system(s) are you seeing the problem on?

Windows

What browser(s) are you seeing the problem on?

Chrome

What version of Bootstrap are you using?

5.3

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked CodePen reproduction in Chrome at a narrow window, then inspect the table wrapper and visually-hidden text in the Bootstrap 5.3 context. Compare the behavior with Firefox and with the visually-hidden text removed or positioned fixed. Done means the accessible hidden text remains while the body scrollbar is not unexpectedly introduced.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, html
Domain
accessibility, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.