Skip to content

SetupDragIn not working inside the web component #2275

@arulselvan

Description

@arulselvan

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,

Utils.getElements(dragIn).forEach(el => {

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...

let list = document.querySelectorAll(els);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions