primeng icon indicating copy to clipboard operation
primeng copied to clipboard

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

Open Sankey1506 opened this issue 1 year ago • 8 comments

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

Sankey1506 avatar Jan 24 '24 15:01 Sankey1506

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!

cetincakiroglu avatar Feb 01 '24 14:02 cetincakiroglu

@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 avatar Feb 08 '24 17:02 Da13Harris

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

Da13Harris avatar Feb 08 '24 18:02 Da13Harris

metaKeySelection="false" solved this issue for me.

freefast avatar Apr 02 '24 01:04 freefast

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 avatar Jul 04 '24 12:07 cwatzl

metaKeySelection="false" solved this issue for me.

This didn't do anything for me

cwatzl avatar Jul 04 '24 12:07 cwatzl

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.

MichaelChambers avatar Aug 17 '24 20:08 MichaelChambers

We are waiting for this to be fixed as well. It should not matter what items are selected, if the user double clicks on an item, it should move that item. If there is a need for a multi-selectable double-click, make it configurable.

Draftscode avatar Nov 14 '24 13:11 Draftscode