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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TextInput scroll issue #5927

Merged
merged 2 commits into from
Feb 1, 2022
Merged

Conversation

jcfilben
Copy link
Collaborator

@jcfilben jcfilben commented Feb 1, 2022

What does this PR do?

Fixes an issue where TextInput would jump back up to the most recent hovered option when scrolling.
The fix moves the content in onClickOutside to a callback function. Using an arrow function was causing unnecessary re-renders which resulted in the jumping scroll behavior. useCallback ensures the component only re-renders when necessary.

Where should the reviewer start?

What testing has been done on this PR?

Tested with TextInput Default suggestion and Custom suggestion stories.

How should this be manually tested?

Any background context you want to provide?

What are the relevant issues?

Closes #4098

Screenshots (if appropriate)

Do the grommet docs need to be updated?

No

Should this PR be mentioned in the release notes?

Maybe

Is this change backwards compatible or is it a breaking change?

Backwards compatible

@britt6612
Copy link
Collaborator

LGTM Thanks, Jessica!

@ericsoderberghp ericsoderberghp merged commit 14ed38e into grommet:master Feb 1, 2022
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.

TextInput suggestion scroll problem
3 participants