primereact icon indicating copy to clipboard operation
primereact copied to clipboard

Picklist: Item is placed at negative index in `event.target`

Open omikader opened this issue 1 year ago • 6 comments

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.

image

Reproducer

https://stackblitz.com/edit/jcwsy5

System Information

primereact: 10.8.4
react: 18.2.0

Steps to reproduce the behavior

  1. Open the PrimeReact PickList basic StackBlitz
  2. Move the first 4 items from source -> target
  3. Move the next item (in my case, bracelet) from source -> target
  4. Move bracelet from the bottom of target to the second position
  5. Move bracelet back from target to source
  6. Move the first item in target (in my case, bamboo watch) to the second position in target
  7. 💥

https://www.youtube.com/watch?v=Af6HkscZiUs

Expected behavior

The items are positioned correctly and event.target is accurate

omikader avatar Nov 08 '24 19:11 omikader

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

tanerengiiin avatar Feb 24 '25 08:02 tanerengiiin

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.

omikader avatar Feb 25 '25 22:02 omikader

I don't have permissions on the repo for Sass only this one

melloware avatar Feb 26 '25 00:02 melloware

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

omikader avatar Apr 30 '25 19:04 omikader

its PrimeTek and @mertsincan

melloware avatar Apr 30 '25 19:04 melloware

@tanerengiiin I can confirm that this still happens in 10.9.1 in the Basic demo

omikader avatar May 26 '25 23:05 omikader