Description
GridStack.setupDragIn not working inside the web component
Tried Gridstack inside the Lit web component, and it's working fine, but the scenario like dragging in the element from the sidebar (https://gridstackjs.com/demo/static.html) does not work inside shadow root.
Environment
-
version of gridstack.js - ^7.2.3
-
which browser/OS - all
Steps to reproduce
GridStack.setupDragIn method need to be called inside the web component(ShadowRoot), The following link has a working demo to reproduce the same inside Lit.
https://stackblitz.com/edit/vitest-dev-vitest-bzx77k?file=src/designer.ts
Expected behavior
Currently, inside setupDragInMethod, we are calling Utils.getElements,
Line 1679 in d99a9f5
Utils.getElements internally using document.querySelectorAll, I think to work inside the shadow root, we need to query inside the parent element or give an argument to the method where we should look in the shadow root scenario...
Line 59 in d99a9f5