You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to the web platform drag and drop security model, you can know what "types" are being dragging during a drag (eg "text/plain"), but you can only see what data is being dragged (exposed through .items) during a successful "drop" event (onDrop()).
I was confused about this until I realized I only get the items on Chrome and FF - not Safari.
Who is implementing the spec correctly - Chrome & FF or Safari?
If Chrome & FF are adhering to the spec, can we expect pdnd to expose items during drag events once Safari catches up?
Are there any suggested workarounds to provide user feedback as soon as a drag starts? I'd like to be able to, for example, enable some drop targets only when the drag has image files.
Thanks!
Some context, in case this helps anyone else who is migrating to pdnd and confused by this.
I was porting from react-dropzone. You provide file constraints to the useDropzone hook, and it uses those for validation when the drag starts. As I migrated the constraints to pdnd, I was puzzled when I didn't get any items to validate in my canDrop callback. I double-checked the native events and saw the items.
Like native events, react-dropzone provides items during drag on Chrome & FF but not Safari. On Safari, it handles any drag as invalid. I had apparently never tested our react-dropzone dnd implementation with Safari until now.
The text was updated successfully, but these errors were encountered:
The docs say:
https://atlassian.design/components/pragmatic-drag-and-drop/core-package/adapters/external/about#monitor-for-external
However, it looks like I can access the items using the native dnd API as seen in this demo: https://stackblitz.com/edit/vitejs-vite-cgmywj?file=src%2FApp.tsx
I was confused about this until I realized I only get the items on Chrome and FF - not Safari.
Thanks!
Some context, in case this helps anyone else who is migrating to pdnd and confused by this.
I was porting from
react-dropzone
. You provide file constraints to theuseDropzone
hook, and it uses those for validation when the drag starts. As I migrated the constraints to pdnd, I was puzzled when I didn't get any items to validate in mycanDrop
callback. I double-checked the native events and saw the items.Like native events,
react-dropzone
provides items during drag on Chrome & FF but not Safari. On Safari, it handles any drag as invalid. I had apparently never tested ourreact-dropzone
dnd implementation with Safari until now.The text was updated successfully, but these errors were encountered: