Skip to content

Conversation

ericsoderberghp
Copy link
Contributor

What does this PR do?

Refactored List key/value handling to reduce code duplication and fix issues with itemKey being a function when ordering.

Without this change, if itemKey was a function then the list ordering wouldn't work because it was only treating it as a string:

const ordItemKey =
   typeof ordItem === 'object' ? ordItem[itemKey] : ordItem;

This issue was uncovered within grommet-designer.

Where should the reviewer start?

List.js

What testing has been done on this PR?

unit tests
various storybook stories
used with grommet-designer to re-order grouped Menu items

How should this be manually tested?

storybook

Do Jest tests follow these best practices?

no tests were canged

Any background context you want to provide?

See above

What are the relevant issues?

no issue

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?

backwards compatible

… issues with itemKey being a function when ordering
@ericsoderberghp ericsoderberghp merged commit 938b7fa into master Nov 3, 2022
@ericsoderberghp ericsoderberghp deleted the fix/list-itemkey branch November 3, 2022 22:20
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.

2 participants