d3lm / ngx-drag-to-select

A lightweight, fast, configurable and reactive drag-to-select component for Angular 10 and beyond
https://www.npmjs.com/package/ngx-drag-to-select
MIT License
293 stars 64 forks source link

[selectOnClick]="false" option prevents initiating a drag box between items #144

Open gavinharriss opened 2 years ago

gavinharriss commented 2 years ago

If you take the README.md https://stackblitz.com/edit/ngx-drag-to-select?file=app%2Fpages%2Fhome%2Fhome.component.html link and add the [selectOnClick]="false" you'll find that the drag box can no longer be initiated from between card items. It's only possible to initiate a selection from the dts-select-container borders.

d3lm commented 2 years ago

Hey there! Thanks for reporting this issue. Please provide a reproduction link using StackBlitz.

gavinharriss commented 2 years ago

No worries, here you go: https://stackblitz.com/edit/ngx-drag-to-select-5xjaaj?file=src%2Fapp%2Fapp.component.html

Just something I noticed while looking at the solution as a potential option to a problem I'm solving.

A screenshot from your live demo - https://d3lm.github.io/ngx-drag-to-select/ 2021-12-01 09_16_56-Angular Drag-to-Select_ v4 2 0_ v4 2 0

d3lm commented 2 years ago

Ah yes, I see. This seems to be a bug indeed.

GRX commented 2 years ago

@gavinharriss did you happen to find a workaround for this?

In my specific case, when you select a group, you should be able to drag that selected group to a different position. Currently, after selecting multiple elements, trying to drag them updates the selection to the single entity you're trying to move.

When [selectOnClick]="false" is set, dragging to select is not working at all anymore :(

gavinharriss commented 2 years ago

@GRX sorry, I never found a fix for the issue.