Skip to content

Drag & drop#492

Draft
Klemen2 wants to merge 1 commit into
DioxusLabs:mainfrom
Klemen2:dnd
Draft

Drag & drop#492
Klemen2 wants to merge 1 commit into
DioxusLabs:mainfrom
Klemen2:dnd

Conversation

@Klemen2

@Klemen2 Klemen2 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

This is blocked on most likely next winit release as it's using the new dnd api

@Klemen2 Klemen2 marked this pull request as draft July 6, 2026 11:29
Comment thread packages/blitz-traits/src/events.rs Outdated
@nicoburns

Copy link
Copy Markdown
Member

Will take a proper look but:

This is blocked on most likely next winit release as it's using the new dnd api

Just wanted to say that this seems like a very sensible choice. I'm anticipating that we'll probably get a new Winit beta once the DnD PR lands.

@Klemen2

Klemen2 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor Author

No need to rush, I've only tested the incoming dnd events and not everything is implemented yet, but it's a great start.
I also think that I need to change how DataTransferReceived is handled since i believe it can come after the drop is handeled

@nicoburns nicoburns left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a look because I was curious and have a left a couple of notes.

And a general comment that:

Drag and Drop actually has three distinct use cases: dragging elements within a page, dragging data out of a page, and dragging data into a page. They have subtly different requirements and implementations.

(https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API)

And this only currently only implements "dragging data into a page". We don't necessarily need an implementation of all 3 at once, but it's at least worth thinking about when designing the API (and I'd personally be kinda tempted to try to handle "dragging elements within a page" too, as I think that might end up changing the design somewhat).

Comment thread packages/dioxus-native/src/config.rs Outdated
Comment thread packages/blitz-traits/src/events.rs Outdated
@Klemen2

Klemen2 commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

I think that the enter/over/leave/drop are now handled correctly (needs #496 to be fixed for bubbling)

I think that the structure can support "dragging elements within a page" but I haven't come to that part yet, also dragable=true needs to handle the event data automagically so yea fun stuff

drag enter/over/leave/drop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants