primereact
primereact copied to clipboard
Picklist: Item is placed at negative index in `event.target`
Describe the bug
I stumbled onto this strange behavior where moving an item from source -> target, repositioning the item, moving it back to source, and then trying to re-order the target list results in the target array having undefined values and items placed at negative indexes, like -1.
Reproducer
https://stackblitz.com/edit/jcwsy5
System Information
primereact: 10.8.4
react: 18.2.0
Steps to reproduce the behavior
- Open the PrimeReact PickList basic StackBlitz
- Move the first 4 items from source -> target
- Move the next item (in my case, bracelet) from source -> target
- Move bracelet from the bottom of target to the second position
- Move bracelet back from target to source
- Move the first item in target (in my case, bamboo watch) to the second position in target
- 💥
https://www.youtube.com/watch?v=Af6HkscZiUs
Expected behavior
The items are positioned correctly and event.target is accurate
It seems like this issue has been resolved in the latest version. Could you please confirm and provide more information if there are any updates? @omikader
Hi @tanerengiiin, thanks for reaching out! I haven't been able to upgrade to the latest version yet because our project uses custom themes and there hasn't been a 10.9.1 release on the primereact-sass-theme package. I created https://github.com/primefaces/primereact-sass-theme/issues/91 to track but haven't heard from the team yet. Would you be able to take a look @melloware? If not, no worries. Thanks.
I don't have permissions on the repo for Sass only this one
Hi @melloware. Sorry to ping on an old issue but do you know who the https://github.com/primefaces/primereact-sass-theme maintainers are?
Would love to see if we could get an updated primereact-sass-theme release so I can upgrade primereact and get the patch for this introduced in 10.9.1
its PrimeTek and @mertsincan
@tanerengiiin I can confirm that this still happens in 10.9.1 in the Basic demo