primefaces / primeng

The Most Complete Angular UI Component Library
https://primeng.org
Other
10.15k stars 4.54k forks source link

PickList: DoubleClick on list item does not move item every item #14622

Open Sankey1506 opened 7 months ago

Sankey1506 commented 7 months ago

Describe the bug

On double click of picklist item in source does not move the item to destination and vice-versa. It seems to be working till version 17.3.0 and broken afterwards.

Environment

Can be produced on https://primeng.org/picklist with v17.3.3

Reproducer

No response

Angular version

17.1.0

PrimeNG version

17.3.3

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

v20.11.0

Browser(s)

Chrome 120

Steps to reproduce the behavior

  1. Go to https://primeng.org/picklist
  2. Double click on item of source list.

Expected behavior

Item should be move to destination

cetincakiroglu commented 7 months ago

Hi,

After conducting research, we have discovered that the issue you mentioned is not specific to version 17, but rather a problem that exists in all versions. This issue is also present in other Prime libraries (PrimeVue & PrimeReact). The source of the problem lies in using mousedown, click, and double click events simultaneously. If a double click is performed on an element that has not been clicked before, it appears that the element does not move. On the other hand, the only way to make this feature work is to first click and then double click, but this does not always give the correct result. Due to technical limitations, it does not seem possible to solve this issue in the upcoming release. Since this issue affects all Prime libraries, we need to collaborate with other teams to come up with a general solution and reassess this feature. We cannot provide a definite answer regarding how long this solution will take. Therefore, I am moving this issue to the 17.Future milestone.

Great catch and thanks for reporting the issue!

Da13Harris commented 7 months ago

@cetincakiroglu

we have discovered that the issue you mentioned is not specific to version 17, but rather a problem that exists in all versions.

While the code may imply that this problem existed before version 17, the double-click behavior definitely worked much better in v16.0.2. We have a use-case in production where this behavior was used consistently for years and now it doesn't work.

I recommend spinning up a v16 version for comparison and try double-clicking. I think you might be surprised by the difference in behavior.

Da13Harris commented 7 months ago

It also works quite well here... https://www.primefaces.org/primeng-v16-lts/picklist

freefast commented 5 months ago

metaKeySelection="false" solved this issue for me.

cwatzl commented 2 months ago

I can confirm this worked better in previous versions. I am getting customer complaints that this feature stopped working properly after upgrading from v15 to v17.

cwatzl commented 2 months ago

metaKeySelection="false" solved this issue for me.

This didn't do anything for me

MichaelChambers commented 3 weeks ago

I would like to add in that for PrimeVue, the double click issue starts with 3.45.0, and is likely related to that also being the first release where the user can click to select more than one node (without using Ctrl). I can click a row which selects it. Then if I double click a different row, the first one I selected is the one that gets moved, not the row I double-clicked. I am staying on 3.44.0 to avoid the issue. A workaround might be to let us have a property to prevent users from selecting more than one row at a time. If it knows it can force single-selection, then in theory any click could deselect a previously clicked row like it seems to do in 3.44.0 and then the double-click could work on the correct row. I'd be happy to use such a single-selection-only property when instantiating my component.