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

[Question] SHIFT behavior by default #79

Open vascocc opened 5 years ago

vascocc commented 5 years ago

First of all, great project. Just have a question. I want to drag multiple times and persist those selections, the same we get with Shift pressed, but I want to achieve that as the default behavior. Is that possible with the current code base? I tried setting the selected cells programmatically but my cells keep flickering (They have a different color when selected). Each time I start dragging, the status of the previously selected cells is set to 'unselected'.

d3lm commented 5 years ago

Hey @vascocc, thanks for the feedback! I am happy to hear that you find some use case for this library.

As to your question, this is currently not supported and there is no option to enable the shift behavior by default. But I could imagine adding this as an option. For example having an additive mode that, when enabled, will not clear the previously selected items and therefore keep adding items to the selection, similar to the shift behavior.

Are you interested in implementing this option? I am happy to help you out and review your PR.

vascocc commented 5 years ago

Hey @d3lm, I like that approach. I'm interested but I'll just be able to do it in a couple of weeks.

vascocc commented 5 years ago

Hey @d3lm, should I use 'additive' or 'addictive'? I just managed to get this feature working and I'm hoping to pull this in the near future.

d3lm commented 5 years ago

Great, looking forward to your PR. Let's go with additive.