gridstack.js icon indicating copy to clipboard operation
gridstack.js copied to clipboard

Can't cancel an external item from being dragged by pressing 'Esc' key

Open adrianbenjuya opened this issue 1 year ago • 2 comments

Subject of the issue

As a user I want to cancel Drag&Drop of a new item from outside the grid by pressing 'Esc' key while the item is being dragged. This works fine for items that are already inside the grid.

Your environment

  • Gridstack demo page
  • Google Chrome

Steps to reproduce

Just drag an external item and press 'Esc' key while dragging

chrome_CTznjhRBKu

Expected behavior

Dragging action should be cancelled, or if not possible at least handle the error.

adrianbenjuya avatar Jun 06 '24 19:06 adrianbenjuya

I added 'Esc' key as an addition to a user paying for the 'r' feature, but I'm not planning to add more options to it (like dragging from outside, which ideally would work too) unless someone wants to donate for it.

adumesny avatar Jun 06 '24 21:06 adumesny

I created a PR where I prevent throwing the error when n.grid is undefined, you can check it out

https://github.com/gridstack/gridstack.js/pull/2698

adrianbenjuya avatar Jun 13 '24 13:06 adrianbenjuya

fixed in next release. don't forget to donate if you find this lib useful!

adumesny avatar Dec 29 '24 23:12 adumesny