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

Add dataKey property to OrderList and PickList components #2187

Closed
alexander-ulaev opened this issue Jul 14, 2021 · 1 comment
Closed

Add dataKey property to OrderList and PickList components #2187

alexander-ulaev opened this issue Jul 14, 2021 · 1 comment
Assignees
Labels
Type: New Feature Issue contains a new feature or new component request
Milestone

Comments

@alexander-ulaev
Copy link

[*] bug report
[ ] feature request
[ ] support request

Codesandbox Case (Bug Reports)
https://codesandbox.io/s/condescending-rain-k7t69?file=/src/demo/OrderListDemo.tsx

Current behavior
In the example from the documentation OrderList component, there is a "dataKey" field in the props. But the OrderList component doesn't use these props. As I see OrderList saves object reference to use it to current selections. This approach gives rise to problems if change OrderList "value".
I wrote a little example on codesandbox.io. try to change order after delete element or add or update.

Expected behavior
I think using "dataKey" instead of object reference will solve this problem. Also, I founding a good idea to add "selectedDataKey" and "onChangeSelected" callback to props. It will help easier make solutions as I show in codesandbox.io.

  • React version:
    17

  • PrimeReact version:
    6.4.1

@mertsincan mertsincan changed the title ordering in OrderList component Add dataKey property to OrderList and PickList components Jul 14, 2021
@mertsincan mertsincan self-assigned this Jul 14, 2021
@mertsincan mertsincan added the Type: New Feature Issue contains a new feature or new component request label Jul 14, 2021
@mertsincan mertsincan added this to the 6.5.0 milestone Jul 14, 2021
mertsincan added a commit that referenced this issue Jul 14, 2021
@mertsincan
Copy link
Member

Hi @alexander-ulaev,
Thanks a lot for your report and codesandbox link!

Best Regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: New Feature Issue contains a new feature or new component request
Projects
None yet
Development

No branches or pull requests

2 participants