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

Fixed Select to continue showing search term after an option is selected #6147

Merged
merged 1 commit into from May 23, 2022

Conversation

jcfilben
Copy link
Collaborator

What does this PR do?

If we have a Select with closeOnChange={false} and search and a user searches then selects an option, the search term will clear but the list of options will still be filtered based on the search term.

This PR changes the behavior so that the search term is not cleared when an option is selected.

Where should the reviewer start?

What testing has been done on this PR?

Tested with the Select/Search story

How should this be manually tested?

Do Jest tests follow these best practices?

  • screen is used for querying.
  • The correct query is used. (Refer to this list of queries)
  • userEvent is used in place of fireEvent.
  • asFragment() is used for snapshot testing.

Any background context you want to provide?

What are the relevant issues?

Closes #6133

Screenshots (if appropriate)

Do the grommet docs need to be updated?

No

Should this PR be mentioned in the release notes?

Yes

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

Backward compatible

@jcfilben jcfilben requested a review from britt6612 May 23, 2022 19:05
Copy link
Member

@ericsoderberghp ericsoderberghp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotta love the size of this change :)

@britt6612
Copy link
Collaborator

gotta love the size of this change :)

think this was the easiest thing Ive ever reviewed 👍

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.

Select search text is cleared (but doesn't call onSearch) after select when closeOnChange=false
3 participants