Skip to content

fix selected multiple when option is no object #6557

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

Merged
merged 3 commits into from
Jan 17, 2023

Conversation

feliperli
Copy link
Contributor

What does this PR do?

This PR fixes #6515 by checking if the option is truly an object before accessing it's property.

Where should the reviewer start?

Look at src/js/components/Select/utils.js

What testing has been done on this PR?

I added valueKey={{ key: 'value', reduce: true }} on select all and clear test

How should this be manually tested?

By creating something similar to https://codesandbox.io/s/grommet-v2-template-forked-l8b45k?file=/index.js

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?

#6515

Screenshots (if appropriate)

Do the grommet docs need to be updated?

No

Should this PR be mentioned in the release notes?

I don't think so because it's a bug 🤔

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

It's compatible

Copy link
Collaborator

@jcfilben jcfilben left a comment

Choose a reason for hiding this comment

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

Looks good!

@ericsoderberghp ericsoderberghp merged commit 2a4385f into grommet:master Jan 17, 2023
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.

SelectMultiple: Clear All does not work with reduce: true in valueKey
3 participants