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

Add react-dnd-touch-backend #1425

Merged
merged 2 commits into from
Jul 3, 2019
Merged

Add react-dnd-touch-backend #1425

merged 2 commits into from
Jul 3, 2019

Conversation

darthtrevino
Copy link
Member

Fixes #1363

@longlho
Copy link

longlho commented Jul 3, 2019

Can we merge this in :) ?

@darthtrevino darthtrevino merged commit 707f4ae into master Jul 3, 2019
@darthtrevino darthtrevino deleted the task/add_touch_backend branch July 3, 2019 18:08
@darthtrevino
Copy link
Member Author

Yep! @longlho I made some updates to the TouchBackend to get it in line with our current TypeScript settings. I'll look into wiring it into the documentation so we can test out out further

@longlho
Copy link

longlho commented Jul 3, 2019

thanks a lot!

@darthtrevino
Copy link
Member Author

darthtrevino commented Jul 4, 2019 via email

@ghost
Copy link

ghost commented Jul 6, 2019

Hi,

<DndProvider backend={TouchBackend({ delayTouchStart: 200 })}> was working for me on react-dnd@8.0.3 with react-dnd-touch-backend@0.8.3. But this syntax caused an error on react-dnd@9.0.0 with react-dnd-touch-backend@9.0.0.

Uncaught TypeError: manager.getActions is not a function
at new TouchBackend (TouchBackend.js:241)
at createTouchBackendFactory (index.js:5)

After changing over to use <DndProvider backend={TouchBackend} options={{ delayTouchStart: 200 }}>, I no longer had the error.

Nevertheless, even with the new syntax to avoid the error, touch drag and drop no longer works for me on my touch device (testing on an iPhone 6 iOS 12.3.1).

For now I've reverted for now back to 8.03 / 0.8.3. Will try to upgrade again sometime. Thanks.

@darthtrevino
Copy link
Member Author

@leantide would you be willing to put up a quick codesandbox demonstrating a working example? The touch-backend is fairly new in this repository, and I'd like to get that to a reliable point

@darthtrevino
Copy link
Member Author

I can repro it on my end. I'll see if I can get this working tonight

@darthtrevino
Copy link
Member Author

darthtrevino commented Jul 6, 2019

Thanks for the report @leantide - this should be fixed in the next patch release

@ghost
Copy link

ghost commented Jul 6, 2019

Thanks @darthtrevino. Using <DndProvider backend={TouchBackend} options={{ delayTouchStart: 200 }}> now works for me on react-dnd-touch-backend @ 9.0.2.

Just a suggestion. Given that there are two backends, maybe it would be beneficial in your docs to show an example of how a web app could support both a mouse interface and touch interface, for example, by using a component that would dynamically use the HTML backend or the touch backend based on the detection of a mouse using
window.matchMedia('(pointer: fine)')
and the detection of touch using
window.matchMedia('(pointer: coarse)')

darthtrevino added a commit that referenced this pull request Feb 3, 2022
* feat: add react-dnd-touch-backend

* refactor: break up touchbackend code
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

Successfully merging this pull request may close these issues.

Merge in react-dnd-touch-backend
2 participants