Skip to content

Conversation

@devongovett
Copy link
Member

Noticed in audit that #8419 had added docs for a "gotcha" in regards to the hidden select causing scrolling. I'd rather we fix this by default instead. In this case, we can use position: fixed on the visually hidden element so it is positioned within the viewport and doesn't cause scrolling. This works because the visually hidden element is also aria-hidden, so positioning it at the top of the page doesn't affect the screen reader cursor placement.

@rspbot
Copy link

rspbot commented Jul 18, 2025

@LFDanLu LFDanLu added this pull request to the merge queue Jul 18, 2025
Merged via the queue into main with commit a98c2a5 Jul 18, 2025
31 checks passed
@LFDanLu LFDanLu deleted the select-gotcha branch July 18, 2025 20:53
@snowystinger
Copy link
Member

This causes a problem if it's inside an element that has drag enabled. The default drag preview will include the entire bounding box union of the target + the hidden select.
In this screenshot, there is a gridlist, and the item with a picker is being dragged. As you can see, it's including the Hello text in the top left as well as the first grid item in the drag preview.
Screenshot 2025-10-14 at 7 25 51 am

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.

6 participants