Skip to content

Fix absolute element scope to button.#23

Merged
haydenbleasel merged 1 commit intovercel:mainfrom
KrisTemmerman:patch-1
Aug 21, 2025
Merged

Fix absolute element scope to button.#23
haydenbleasel merged 1 commit intovercel:mainfrom
KrisTemmerman:patch-1

Conversation

@KrisTemmerman
Copy link
Copy Markdown
Contributor

@KrisTemmerman KrisTemmerman commented Aug 20, 2025

The Actions component applies a sr-only class for screen reader accessibility, but this causes an unintended side effect where a double scrollbar appears on the page.

image

Root cause:
The sr-only class uses position: absolute without a positioned parent container, causing the absolutely positioned element to be positioned relative to the document body or a distant ancestor, which triggers overflow and creates the extra scrollbar.

Add position: relative to the Button component to establish a proper positioning context. This ensures the sr-only element is positioned relative to the Button itself rather than escaping to a parent container.

…snt cause extra scrollbars

When using the Actions component there's an added sr-only class for screenreaders, however this adds a  
```
.sr-only{position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border-width: 0;}``` 
which causes an extra scrollbar to appear. adding relative to the Button, makes sure the position absolute is scoped to the Button and not the parent container
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Aug 20, 2025

@KrisTemmerman is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@haydenbleasel
Copy link
Copy Markdown
Contributor

Nice find! Thanks @KrisTemmerman

@haydenbleasel haydenbleasel merged commit 8bc46eb into vercel:main Aug 21, 2025
1 of 2 checks passed
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.

3 participants