-
Notifications
You must be signed in to change notification settings - Fork 25.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Call out JS interop and HTML5 specs for Blazor drag-'n-drop #19913
Comments
Hello @Jarek300 ... I'll put it up for potential work; but given the great demands for high priority (new feature) coverage, it will take some time to get to this. We're all 🏃😅 like crazy on .NET 5 basic feature coverage for the .NET 5 release coming up end of year ... and then the holidays 🎁 are going to hit with big vacations 🏖️ (including mine! Woot! 😁). There are also prior commitments to backlogged issues that should be addressed on the topics and sample apps. I'll schedule this, but I'm just letting you know that it will take into Q1 of next year to get to it. I recommend in the meantime that you consult with the community on it if you're looking for tips ... blog posts ... assistance if you're having trouble. We recommend the usual support channels, which you're probably already familiar with ... I'll get to this and see what we can provide as soon as I can. 🏃🏃🏃🏃🏃 |
I've already searched many channels but it seems that nobody have managed to use fully blazor drag events. I hope that is is beceause of lack of documentation not because that events don't work at all. For example, this post https://chrissainty.com/investigating-drag-and-drop-with-blazor/ by Chris Sainty don't use blazor ondragstart event but JavaScript DOM ondragstart event. Others use blazor drag events only to init or end drag operation but data from the source to the target is transfered using some globla/session store not DataTransfer object. |
I understand your pain on this, but my hands are tied at the moment in terms of looking at this right now. All of my effort at this time is directed to the .NET 5 updates in order to make sure that we have docs for basic features at 5.0's release, which is rapidly approaching ⏰. I haven't worked with drag events in Blazor, so I can't rattle off anything helpful or show something from a test sample. I would need to dedicate time to research, experiment, and reply, and I just don't have any time at the moment. I recommend hitting up the Blazor devs on the Slack and Gitter chats that I linked. I'm confident that some of those devs have worked with drag events. I'll make sure that we get to this issue asap. |
There's a tidbit in the engineering basic test app. See if it provides a hint ... |
Unfortunately not. It is a basic test of receiving mouse events. Implementation of OnDragStart event handling:
doesn’t even touch a property 'e. DataTransfer'. I'm going to wait till November and see if creating documantation of using drag-and-drop in Blazor is then possible. |
I'm waiting on some reviews, so I had time to search and see what devs are doing ... like this for example by @chrissainty ... https://chrissainty.com/investigating-drag-and-drop-with-blazor/ Thank you, Chris, that's an excellent read ... the best really that I see.
eeeeeee yuck! 😖 lol ... not C# ... not very Blazor-y-ish™️ 😄 ... so I went and looked to see feedback to the product unit and planning, and there are several issues. Chris also remarks on one or more engineering issues on this subject. Here are the ones that popped up on my search ...
This one is the best and most recent for the planning ... ... and there's a cross-linked planning discussion doc by Mackinnon Buck ... https://gist.github.com/MackinnonBuck/374e529e9c3fdb9d228214b4cc79e617 ... but it's going to be for post-5.0 GA (cut here on the engineering tracking issue) ... so next year perhaps. When you go the JS interop route with something like this, you're obviously just using the Drag and Drop API ... thus using any of a thousand posts out there on how HTML5 drag and drop works ... tutorials/examples ... gotchas/special use case articles ... etc. This subject won't be actionable as an example for our docs on that basis. However, the topic should call this out. It should state that JS interop is the right direction for most use cases and link to the Blazor JS interop topic and MDN doc. The dev can then search out examples on the Net from there. I'm going to go ahead and work this on that basis. |
Thanks @guardrex, I'm glad you liked the article. Always high praise coming from you 🙂. |
Could you provide working example of using drag events i.e. ondragstart, ondragover and ondrop? Example should show how to put data into DataTransfer and DataTransferItem objects and how data is received in ondrop.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: