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.

Touch backend not working

See original GitHub issue

Hi -

The documentation does not address this but is the touch backend supposed to simply add touch based dragging or it excludes the regular dragging (in which case is there an all in one backend?..)? I ask because I had setup a basic card for dragging which was working fine on the HTML5 Backend but when I switched to the TouchBackend it stopped working.

  const [{isDragging}, drag, preview] = useDrag({
    item: {
      type: ItemTypes.CARD,
    },
    collect: monitor => ({
      isDragging: !!monitor.isDragging(),
    })
  })

// structure of how I laid out the draggable component.
<div ref={preview}>
  <div ref={drag}>
  // some svg icon as handler
  </div>
</div>

Any help is appreciated. Thanks.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:3
  • Comments:15 (1 by maintainers)

github_iconTop GitHub Comments

8reactions
VladislavRUScommented, Aug 9, 2020

I have the same issue - preview not showing up while using TouchBackend

4reactions
nerdogramcommented, Jul 20, 2020

Ah that seems to have done it! Although now the preview when I drag is not working. Is

        collect: (monitor) => ({
            isDragging: monitor.isDragging(),            
        }),

Not supported or called something else?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Touch Backend - React DnD
So it will not work on tablet and mobile devices. You can use the react-dnd-touch-backend for touch devices. Installation. Run the following command...
Read more >
Can't see the item that I am dragging using React-dnd
And when I do, everything works fine except that I don't see items that I am dragging.
Read more >
react-dnd-touch-backend - npm
Touch backend for react-dnd. ... Start using react-dnd-touch-backend in your project by running ... This package does not have a README.
Read more >
react-dnd-touch-backend examples - CodeSandbox
Learn how to use react-dnd-touch-backend by viewing and forking react-dnd-touch-backend example apps on CodeSandbox.
Read more >
react-dnd-touch-backend-dk - npm package - Snyk
The npm package react-dnd-touch-backend-dk was scanned for known vulnerabilities and missing license, and no issues were found. Thus the package ...
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