-
Notifications
You must be signed in to change notification settings - Fork 991
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
SPFX and react-dnd #4808
Comments
Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible. |
Noticed something weird here - when I have the workbench in Edit mode it show the behavior described above. When I click on Preview mode - it works as expected. Any ideas why? |
Ran into a similar problem building a web part that closely reflects the out-of-the-box People (picker) web part. In our case, we used HTML5 drag/drop API to create a sortable list. We found that the drag/drop events (specifically, dragover and drop) were not triggering when in edit mode. However, once in preview/display mode, everything worked fine. From what I could tell, the built-in web part drag/drop functionality is what's interfering here. While in edit mode, I could select my draggable elements and dragstart would fire, however, once I tried dragging the element, I'd see the web part drop zone indicator kick in, showing where my dragged element would be placed in respective web part drop zones on the page. Using Chrome dev tools, i could see that there's two The workaround to this seems to lie in properly leveraging React references (or something else I'm not knowledgeable enough to know more about) to bind the events to the elements you want. React-dnd seems to have features that help with this, such as the hooks useDrag and useDrop. The react-list-form web part seems to accomplish this using the legacy decorators to create a drag source/drop target. You can also read more about them in the overview documentation. |
Drag and drop with react-dnd does not appear to work at all for me in spfx. We just converted a react app to spfx and it was working fine before. Any help? |
I am facing the same issue. In my case drag & drop was working fine in SPFx 1.9.1 but when I upgraded to SPFx 10.0, it stopped working. |
I am working on V1.10 and onDragEnd is not working either. Here is the div element. The drag and drop works in the workbench like a champ, then in a live site stops functioning.
Upon further inspection, when I drop the the onDragEnd event.datatransfer.dropEffect returns "move" in edit mode and "none" in preview/production site.
|
Hello all, |
This should now be rolled out fully |
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues |
Category
Is somebody using SPFX with react-dnd.
I am trying to get some basic drag and drop functionality in an SPFX webpart - in the local workbench it works as expected, as soon as I go to a live site, the onDrop will no longer trigger.
All help is appreciated - I am obsessing with this for days now and have well passed my chocolate/bug allowance.
Here is my code, just create a HelloWorld and replace the code as below:
The text was updated successfully, but these errors were encountered: