question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cleaning up "draggable"

See original GitHub issue

Hi Bernardo, nice work!

I have one issue: If you go to: http://sslweb.azurewebsites.net/

  1. click the bottom left icon (sort)
  2. drag and drop a list-item to manually sort the list
  3. click again the bottom left icon to disable sorting

Result on phones (tested on android and windows phone)

  • still possible to drag an item
  • scrolling on the list is broken

I guess there is something wrong with the event cleanup. In the list you can find items like <div class="win-itembox" draggable="true">. The draggable attribute will be removed by clicking the ‘disable sorting’ icon.

How can I access the ‘DragDropTouch’ object on the ‘.win-itembox’ element to do some cleanup?

Best Regards, George

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Bernardo-Castilhocommented, Jul 18, 2016

Hi George

Glad you like the library.

I inspected your sample app on my Google Nexus and I think I see what the problem is. The DragDropTouch code is looking for the presence of the “draggable” attribute, not to its value. This is a bug. I thought draggable worked like “disabled” or “required”, but it does not. The attribute can be set to true or to false.

I will review the code and apply a fix ASAP.

Thanks a lot for reporting this issue.

In the meantime, if you don’t want to wait, perhaps you could try removing the draggable attribute from the elements instead of setting it to false. That should fix the problem. Hopefully…

0reactions
Bernardo-Castilhocommented, Jul 18, 2016

Thank you for helping me improve the library.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to cleanup "react-beautiful-dnd" Draggable after removal?
I'm using this awesome react-beautiful-dnd library to let users reorder a list of items by "drag and drop". It works just fine.
Read more >
Draggable doesn't clean up inline style - GSAP - GreenSock
Hey guys,. I feel like calling kill() on a Draggable instance should probably clean up after itself and reset the DOM element it...
Read more >
Cleaning The Drag System On Your Spinning Reel In Just 5 ...
Is there a sweeter sound than hearing your drag scream?It's music to any angler's ears, but it only screams if your drag system...
Read more >
Drag operations - Web APIs - MDN Web Docs - Mozilla
You can clear the data using the clearData() method, which takes one argument: the type of the data to remove. event.dataTransfer.clearData(" ...
Read more >
How To Clean Your Spinning Reel Drag System (In Just 5 ...
Want to make sure your drag system works like new for a long time? Check out this simple process to clean and maintain...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found