-
Notifications
You must be signed in to change notification settings - Fork 841
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
SelectableList: add optional key
property to options
prop
#2608
SelectableList: add optional key
property to options
prop
#2608
Conversation
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.
Thanks @mbondyra for starting this PR.
You'll need to also add a changelog entry (last checklist item in the PR summary). You should be able to follow suit from the other items. Just make sure the entry it past tense.
Co-Authored-By: Caroline Horn <549577+cchaos@users.noreply.github.com>
@cchaos I added the changelog note. If it can be grammatically improved don't hesitate to add a suggestion 🙏 |
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.
Tested in Chrome, it works correctly. 👍
Just one more comment for the changelog.
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.
Changes LGTM; pulled and tested locally
39cdf44
to
09aabe0
Compare
key
property to options
key
property to options
prop
Summary
Fixes #2605
This is a proposed solution for fixing the React warning about duplicate keys for SelectableList if we pass two identical labels. The situation happens eg. for Index Pattern Chooser in Lens if index pattern was imported from Saved Object and the identically named index pattern existed in the app.
Adding optional prop 'key' for Option Interface would allow having two different objects with identical labels without throwing the warning.
Still, the PR doesn't fix the problem of differentiating two identically labelled objects from a user perspective.
Checklist