Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

VisuallyHidden triggering overflow in Chrome #4176

Closed
filipw01 opened this issue Mar 8, 2023 · 0 comments 路 Fixed by #4177
Closed

VisuallyHidden triggering overflow in Chrome #4176

filipw01 opened this issue Mar 8, 2023 · 0 comments 路 Fixed by #4177

Comments

@filipw01
Copy link
Contributor

filipw01 commented Mar 8, 2023

馃悰 Bug Report

When there are two siblings first 100% height and second VisuallyHidden it shows as overflow on chrome
This happens only in chrome

馃 Expected Behavior

There should be no overflow, VisuallyHidden shouldn't affect the visual side

馃槸 Current Behavior

Only in Chrome, but there's an overflow

馃拋 Possible Solution

Change margin from 0 -1px -1px 0 to -1px solves the issue. I know Tailwind uses it https://tailwindcss.com/docs/screen-readers and because it's position absolute I don't think there would be any issues with siblings positioning even though we're offsetting 2px in total while the height of the element is only 1px

馃敠 Context

I'm rendering Popover overlay in a portal, and the dismiss button wrapped in VisuallyHidden creates the overflow

馃捇 Code Sample

https://stackblitz.com/edit/vitejs-vite-hte89a?file=src%2Fmain.jsx

馃實 Your Environment

Software Version(s)
react-spectrum 3.23.1
Browser Arc Version 0.92.0 (37470) - Chromium Engine Version 110.0.5481.177
Operating System MacOS 13.2.1

馃Б Your Company/Team

ChiliPiper https://www.chilipiper.com/

majornista added a commit to filipw01/react-spectrum that referenced this issue Mar 9, 2023
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 a pull request may close this issue.

1 participant