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

When dts container is destroyed, items are unselected #163

Closed Eagleseb closed 2 years ago

Eagleseb commented 2 years ago

Hey,

Because in the complete https://github.com/d3lm/ngx-drag-to-select/blob/75a05d48cbf18814430d476e161230dce580cd01/projects/ngx-drag-to-select/src/lib/select-container.component.ts#L318 an empty array is emitted, elements are always unselected when dts container is destroyed.

This is annoying if selected items list is shared with other components.

I suggest to not emit an empty array if there are not any good reasons for that.

Best, Sébastien

Eagleseb commented 2 years ago

Actually I noticed that the select Output does just that already. You may close my issue and reject my PR :) sorry for the trouble

d3lm commented 2 years ago

Oh no worries, glad you figured it out. Thanks!