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

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

Open
omikader opened this issue Nov 8, 2024 · 0 comments
Open

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

omikader opened this issue Nov 8, 2024 · 0 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@omikader
Copy link

omikader commented Nov 8, 2024

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 omikader added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant