taye / interact.js

JavaScript drag and drop, resizing and multi-touch gestures with inertia and snapping for modern browsers (and also IE9+)
http://interactjs.io/
MIT License
12.2k stars 782 forks source link

🐛 webcomponent slot drag element not subject to parent slot #950

Closed duoduoObama closed 2 years ago

duoduoObama commented 2 years ago

Expected behavior

When the slot element of a web component is dragged, it should be based on the position of the parent element of the slot

Actual behavior

webcomponent slot drag element not subject to parent slot

System configuration

interact.js version:1.10.11 Browser name and version:chrome 97 Operating System:win 10

webcomponent slot drag element not subject to parent slot

https://stackblitz.com/edit/vitejs-vite-pppejv?file=src%2Fcomponents%2Findex.ts&terminal=dev

taye commented 2 years ago

The custom-element has display: inline by default so it doesn't have a size. It works if you give it CSS display: inline-block.

duoduoObama commented 2 years ago

Similar issues: https://github.com/daybrush/moveable/issues/684