Description
Provide a general summary of the issue here
The VisuallyHidden
component from react-aria
, used as described by the documentation, breaks page styling at certain viewport dimensions. Namely, if the element that it's being used with is offscreen and needs to be scrolled to in order to be interacted with, doing so will break the height and flex flow of the parent container in some strange way.
🤔 Expected Behavior?
Using the VisuallyHidden
component should have no effect on the rest of the page.
😯 Current Behavior
Interacting with a component that uses VisuallyHidden
breaks the surrounding page layout under the conditions mentioned above and shown in the below example.
💁 Possible Solution
No response
🔦 Context
Using the component as described by the documentation breaks my application's styling, something which took a good chunk of time to pinpoint. The VisuallyHidden
component should only hide its children nodes and have no effect on the rest of the DOM.
🖥️ Steps to Reproduce
- Open this example.
- Resize your browser window so that the checkboxes at the bottom of each column overflow off the bottom of the screen.
- Scroll down to the bottom checkboxes. Click "Working Option 15" and observe that it behaves exactly as you'd expect.
- Now click "Broken Option 15" and observe that it breaks the page layout by shifting everything upwards
- Open the source code here. Observe that the
Checkbox
component - the one that does not break the styling - applies adisplay: none
rule to theinput
element in order to hide it, rather than using theVisuallyHidden
component fromreact-aria
. Observe that theCheckboxWithVisuallyHidden
component does useVisuallyHidden
, and that interacting with that version of the checkbox breaks the page.
Version
"react-aria": "^3.28.0",
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
MacOS Ventura 13.3.1
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
Metadata
Metadata
Assignees
Type
Projects
Status
🩺 To Triage