atlassian / pragmatic-drag-and-drop

Fast drag and drop for any experience on any tech stack
https://atlassian.design/components/pragmatic-drag-and-drop
Other
7.45k stars 133 forks source link

IFrame Support #24

Closed edge-rps closed 1 month ago

edge-rps commented 1 month ago

I'm interested in using Pragmatic Drag-and-Drop within an iframe component like react-frame-component. Is this supported?

I've seen some discussions online suggesting it might be possible with limitations, but I couldn't find any official documentation on this.

glani commented 1 month ago

+1. Original Ads showed iframe process. Where is it? This is the most interesting part how to get it worked between windows

edge-rps commented 1 month ago

For those that need a quick fix, it's possible to use react-dnd as an alternative and it works with sortable.

https://github.com/react-dnd/react-dnd/ https://react-dnd.github.io/react-dnd/examples/sortable/simple https://codesandbox.io/p/sandbox/iframe-example-ilfwt

alexreardon commented 1 month ago

Great news! Pragmatic drag and drop works with iframes. If it's possible with the web platform, it's possible with Pragmatic drag and drop.

For iframes, you will want to use the external adapter

I hope to post a video with more detail about this whole flow soon.

Here is the demoed example. I would caveat that this example takes some shortcuts that you will need to think about for a production experience. I'll elaborate in the planned video

yassilah commented 2 weeks ago

Hi! I'm also trying to use Pragmatic drag and drop to drop elements into an iframe within the same document but it doesn't seem to work? I'm most certainly doing something wrong, so I made a basic reproduction here in case you could help me figure it out 😅 https://stackblitz.com/edit/vitejs-vite-fpbsjy?file=src%2FApp.vue

Thanks for all your work!