angular-gridster2 icon indicating copy to clipboard operation
angular-gridster2 copied to clipboard

Scrolling the grid with "verticalFixed" mode and emptyCellDrag enabled

Open gwartnes opened this issue 9 months ago • 0 comments

First of all, this is an excellent library and we have gotten a lot of great use out of it! Keep it up!

One thing that we have recently noticed is that when we are in the "verticalFixed" mode, and widgets are overflowing vertically (thus a vertical scrollbar appears), and we also have enableEmptyCellDrag enabled (with its associated callback), then when scrolling by using your mouse pointer and dragging the scrollbar up and down (i.e. not by using your scroll wheel or keyboard), it also is counting this as an event where it's detecting a drag across empty cells.

Here is a minimal reproduction:

Demo: https://stackblitz-starters-pcalda.stackblitz.io Editor: https://stackblitz.com/edit/stackblitz-starters-pcalda?file=src%2Fmain.ts

Is there a way we can block the scroll event from triggering the emptyCellDragCallback? One possible solution that I can think of is to set up event listeners for scroll and scrollend on the gridster component itself, and then in the emptyCellDragCallback, block further processing if we are between a scroll and scrollend event. While this might work, it does seem kind of messy. Any other way around this?

gwartnes avatar Sep 21 '23 20:09 gwartnes