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 able to drag and drop on mobile using React Portal #582

Closed
Chariyski opened this issue Jun 26, 2018 · 16 comments
Closed

Not able to drag and drop on mobile using React Portal #582

Chariyski opened this issue Jun 26, 2018 · 16 comments

Comments

@Chariyski
Copy link

Chariyski commented Jun 26, 2018

Bug or feature request?

Bug

Expected behavior

To be able to drag and drop items on mobile.

Actual behavior

The items are marked as draggable, but can't be dragged.

Steps to reproduce

Go to https://codesandbox.io/s/3465m7xmw6 and open mobile emulation.

What version of React are you using?

16.3

What version of react-beautiful-dnd are you running?

7.1.3

What browser are you using?

Chrome

@alexreardon alexreardon changed the title Not able to drag and drop on mobile Not able to drag and drop on mobile with react-modal Jun 26, 2018
@alexreardon alexreardon changed the title Not able to drag and drop on mobile with react-modal Not able to drag and drop on mobile with react-modal Jun 26, 2018
@alexreardon
Copy link
Collaborator

We'll track as a part of #567

@alexreardon alexreardon changed the title Not able to drag and drop on mobile with react-modal Not able to drag and drop on mobile using React.Portal Jun 26, 2018
@alexreardon alexreardon reopened this Jun 26, 2018
@alexreardon
Copy link
Collaborator

Here is an independent example that shows of the behaviour: https://codesandbox.io/s/nr75vkklnm

This example does not use react-beautiful-dnd at all. It looks like moving something into a portal after a touchstart stops any window touchmove and touchend events from firing.

Here is an example that uses a React.Portal but it shifts the component into a component before a touch start. That works fine. https://codesandbox.io/s/v54x54vp5

I will create an issue on the React project to track this.

Unfortunately given that this issue is with React.Portal itself we are unable to action this directly

@alexreardon alexreardon changed the title Not able to drag and drop on mobile using React.Portal Not able to drag and drop on mobile using ReactDOM.Portal Jun 26, 2018
@alexreardon alexreardon changed the title Not able to drag and drop on mobile using ReactDOM.Portal Not able to drag and drop on mobile using React Portal Jun 26, 2018
@alexreardon
Copy link
Collaborator

React issue created: facebook/react#13113

@alexreardon
Copy link
Collaborator

I'll update the docs to let people know about this issue

@alexreardon
Copy link
Collaborator

This is surpising as I thought I tested using portals on mobile... very confusing.

Oh well, I am able to reproduce it outside of this library so for now we cannot really do too much :(

@alexreardon
Copy link
Collaborator

I have created a warning in the docs: #583

@alexreardon
Copy link
Collaborator

This is also caused by the removing of the existing node and re-creating of one. It looks like there could be a workaround which I will explore: facebook/react#13113 (comment)

@Chariyski
Copy link
Author

Hello,
any news about the problem ?

@alexreardon
Copy link
Collaborator

i have not digged into this one yet

@paceto256
Copy link

Any chance to use this solution facebook/react#13113 (comment) ?

@alexreardon
Copy link
Collaborator

This might be fixed as a part of our event changes for #1293

@alexreardon
Copy link
Collaborator

I am looking into this as a part of #1293

@alexreardon
Copy link
Collaborator

I can confirm I have found a workaround for this as a part of #1293. The new pattern also works with dragging clones which is needed for virtual lists

/cc @TrySound

@TrySound
Copy link
Contributor

Awesome

@alexreardon
Copy link
Collaborator

alexreardon commented May 20, 2019

Shipping in 12.0 #1317

@alexreardon
Copy link
Collaborator

Fixed in 12.0.0-alpha.7

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

No branches or pull requests

4 participants