-
Notifications
You must be signed in to change notification settings - Fork 23
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix FilterSelect jumping issue #5477
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: e20b8b0 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Validated this would in survey-reporting-ui with the canary |
3bbc720
to
5b56c59
Compare
5b56c59
to
426898d
Compare
ae09c1f
to
426898d
Compare
if (lastYPosition === null) { | ||
setLastYPosition(y) | ||
} else if (y === lastYPosition && y >= 0) { | ||
setIsStable(true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense, and is possible to clear the interval here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why
This is a second (third?) attempt at resolving the Select / FilterSelect jump issue.
Steps to replicate (prior to this fix)
In chrome
Why we think this happens
This component is composed of many primitive that seek to control focus management. The suspected culprit is the React Aria listbox keyboard behavior.
We've had to try a co-opt its focus management manually but due to how it renders, seemingly its start position is above the page, causing the jump on focus.
What
I've introduced a hook that checks for a stable y position that should ensure that the focus resolve after it is a single value