[fix] ComboBox scroll behavior #1693
Labels
high priority
Active blocker for a current project or just urgent
type: bug
Something isn't working like it's supposed to
ReactUSWDS Version & USWDS Version:
ReactUSWDS 2.2.0 (not present in USWDS)
Describe the bug
I'm using the ComboBox in an application, and when I click into the input it moves the scroll position of the entire page which is a bad UX. I cannot reproduce this in the USWDS Combo Box example so I think it's something to do with our implementation.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
When I click into the input, the scroll position of the page should not change.
Screenshots
Scroll bug:
Compare to:
Additional context
It looks like the USWDS source code adjusts the
scrollTop
of the list element itself, whereas our component usesscrollIntoView
on the highlighted item. I'm guessing that's what is causing this behavior.The text was updated successfully, but these errors were encountered: