Jump to content

Drag and drop not working


Recommended Posts

Hey guys,

I am currently working on GUI for my server.
I am using ReactJS and for drag and drop i am using SortableJS.
The issue i have is that drag and drop does not seem to work even though it works in the browser.
I tried to debug events and it seems that onDragStart doesn't run on clicking div container.
While writing this i wanted to be sure that it isn't something that i did in react so i created almost blank html page with one div in it:


<!DOCTYPE html>
<html lang="en">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
        onclick="document.getElementById('root').innerHTML = 'Clicked'"
        ondragstart="document.getElementById('root').innerHTML = 'Draggable start'"
        ondragend="document.getElementById('root').innerHTML = 'Draggable end'"
        style="width: 10rem; height: 10rem; background-color: antiquewhite;" 


After it loads it only fires onclick event, dragging is ignored (It works in chrome). I don't really know what to do...
Do i have to insert some flag somewhere or do something to enable drag and drop? Or do i have to do some hacky ways to get drag and drop?

Link to comment
Share on other sites

  • 4 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...