-
Notifications
You must be signed in to change notification settings - Fork 361
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
DualListSelector: support list of objects as options #6213
Comments
cc @nicolethoen |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
I think this can still happen - @xprazak2 is this still something you need? |
@nicolethoen, there is no urgent need, it is an enhancement that would make it easier to use the component. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
For now, there is a way to pass more data to available or chosen options in a dynamically generated DualListSelector. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Can we reopen this issue ? Basically the solution proposed is: Build an array of React Node and hide the id in the data-id property.
Then in the
It seems a little hacky to me. And it adds extra work in my code because I need to create and save availableOptionsByIds apart instead of using availableOptions directly. -- One solution for me is to use (like in other components like Patternfly Select component) an array of string or an array of Object with a toString method. Or define an API saying, if you pass an array of object, you need a 'name' properties. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Describe the issue. What is the expected and unexpected behavior?
availableOptions
andchosenOptions
props have the typeReact.ReactNode[] | DualListSelectorTreeItemData[]
. When using basic select (no tree/checkboxes), I would like to pass array of objects as available and chosen options.The use case is to separate what is presented to user for selection and how the items are identified. We often want to present a user-friendly name while keeping track of the items by id.
Please provide the steps to reproduce. Feel free to link CodeSandbox or another tool.
A posiblilty is to use a formatter function:
{ id: 'abx', toString: () => "Pretty name for users" }
Is this a bug or enhancement? If this issue is a bug, is this issue blocking you or is there a work-around?
Enhancement
The text was updated successfully, but these errors were encountered: