Skip to content
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

Not working in mobile #6

Open
riocallos opened this issue Sep 11, 2019 · 7 comments
Open

Not working in mobile #6

riocallos opened this issue Sep 11, 2019 · 7 comments

Comments

@riocallos
Copy link

Cannot drag puzzle pieces

@shankie-codes
Copy link

I'm not a contributor on this project, but I've done a hack of this to get it working on mobile. Basically, the react-dnd component that it uses has two backends: the one that this project uses (html5) and one that supports touch.

I've forked this project and then, on component mount, detect whether the user is using a touch device and then load the appropriate backend.

It's a bit of a faff – but could be integrated into this project with a small amount of work.

@fBruzja
Copy link

fBruzja commented Apr 22, 2020

@shankie-san Could you please explain how have you managed that in a bit more detail? I am trying to do that in react-native, but to no avail...

@shankie-codes
Copy link

Sure @fBruzja . I'm a bit short on time so can't explain in detail, but what I've done here https://github.com/shankie-san/hollys-face/blob/master/src/components/Puzzle.js might be of use to you (sorry about this repo – it's a quick-and-dirty personal project).

Maybe with React Native you'll need to configure react-dnd with an appropriate backend for RN?

I guess the solution for this project would be the option to override the DND backend with one that you provide yourself...

@fBruzja
Copy link

fBruzja commented Apr 23, 2020

@shankie-san I think this is enough to get me started on. Thank you, much appreciated!

@shankie-codes
Copy link

shankie-codes commented Apr 23, 2020 via email

@kunaltyagi9
Copy link

Hi @fBruzja, Have you resolved this?

@kunaltyagi9
Copy link

@fBruzja @shankie-codes I did this as per the latest update of the libraries, but I am not able to drag puzzle pieces on mobile

<DndProvider backend={TouchBackend}>
      <Puzzle
        image="https://upload.wikimedia.org/wikipedia/en/6/68/John_Coltrane_-_Blue_Train.jpg"
        onDone={() => alert("Wow!")}
        level={3}
      />
</DndProvider>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants