twbs / twbs/bootstrap

Adding .visually-hidden to table results in it taking up space

Open
#41,790 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Prerequisites
Describe the issue

If I apply the visually-hidden class to a <table> element then in some browsers it appears to take up space still, resulting in scrollbars, even though the table isn't visible.

  1. Create a page with a <table class="visually-hidden"></table> element.
  2. Add enough contents to it that it would be longer than the page

On macOS, in Safari 26.0.1 and Chrome 141.0.7390.55 I see this problem. Firefox 141 does not exhibit the issue.

Reduced test cases

Here's a codepen - see the vertical scrollbar in the apparently empty main area: https://codepen.io/philgyford/pen/dPGNyoE

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

macOS

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

Chrome, Safari

What version of Bootstrap are you using?

v5.3.8

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 reduced CodePen test case and reproduce the issue in Safari and Chrome on macOS, then compare the behavior with Firefox. Inspect the visually-hidden class as applied to a table and determine a change that prevents hidden tables from creating scrollbars while preserving the class's intended behavior. Done means the reproduction no longer shows the unwanted scrollbar in the affected browsers.

Written by the indexing model from the issue text.

Assessment

Tech stack
css, html
Domain
accessibility, frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.