dnd-kit icon indicating copy to clipboard operation
dnd-kit copied to clipboard

[next] Shadow dom support?

Open du33169 opened this issue 5 months ago • 5 comments

The current positioning of the "cloned pseudo-dragging element" (how do you name it?) is problematic inside a shadow dom.

Preview:

Image

CodeSandBox: https://codesandbox.io/p/sandbox/keen-bell-jm6lkv

du33169 avatar Jul 12 '25 06:07 du33169

Agreed, we are also struggling with this, styling gets totally broken.

mjansrud avatar Aug 12 '25 13:08 mjansrud

+1

alicanso avatar Aug 20 '25 09:08 alicanso

seeing the same thing. Any potential workarounds?

spawnxe avatar Aug 28 '25 02:08 spawnxe

For anyone you would read this while trying to make it work with the new Polaris components, you need to make sure that the ref (on the experiemntal branch of DndKit) is applied to a div and NOT to a <s-> component. The reason is that all the <s-> components are set with display: contents, which mess all the calculations.

So instead of:

<s-grid ref={ref}>
...
</s-grid>

Make sure to do that instead:

<div ref={ref}>
  <s-grid></s-grid>
</div>

bakura10 avatar Sep 11 '25 05:09 bakura10

@clauderic Any updates? Or some guidance on where to start if someone wants to help?

du33169 avatar Dec 02 '25 02:12 du33169