katoid / angular-grid-layout

Responsive grid with draggable and resizable items for Angular applications.
https://katoid.github.io/angular-grid-layout
MIT License
462 stars 61 forks source link

feat: add manual drag event handler #87

Closed pcurrivan closed 1 year ago

pcurrivan commented 1 year ago

Resolves #86

Adds an alternative event-based way to initiate dragging. This provides a way around the limitations of the current dragging options, namely:

Adds a public method, onManualDragStart, to the grid-item component. This method accepts pointer down events, and uses them to initiate dragging, ~regardless of the draggable setting. Added comments recommending setting draggable to false if using manual drag events. For example:~

~<ktd-grid-item #gridItem [draggable]="false"> <my-item (myDragHandleMouseDownEvents)="gridItem.onManualDragStart($event)"></my-item> </ktd-grid-item>~

pcurrivan commented 1 year ago

I realized a couple of things are missing from this:

TODO:

pcurrivan commented 1 year ago

This should be ready.

llorenspujol commented 1 year ago

Thanks for you PR @pcurrivan !

I agree on the solution, I just would change some small details!

Let me know what you think, I added my suggestions on the issue: https://github.com/katoid/angular-grid-layout/issues/86#issuecomment-1563031368

pcurrivan commented 1 year ago

@llorenspujol

I responded to your comment https://github.com/katoid/angular-grid-layout/issues/86#issuecomment-1563095780

llorenspujol commented 1 year ago

Merged!! 👏