Description
Do you want to request a feature or report a bug?
Bug 🐞
What is the current behavior?
When you move a component into a React Portal in response to a touchstart
the touchmove
and touchend
events are swallowed for the rest of the interaction
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:
Example: https://codesandbox.io/s/nr75vkklnm
You will either need to be on touch device, or enable touch sensors in your browser to see this
Steps:
- add a
onTouchStart
listener to a component - in response to
onTouchStart
move the component into a Portal - touchmove events and the touchend events are then blocked for the rest of the touch interaction
If the component is already in a component before the touchstart event then the events are emitted correctly: https://codesandbox.io/s/v54x54vp5
I have also created a vanilla js example that has a portal implementation. It moves the element into a portal after touch start. It is correctly allowing touch touchmove and touchend events: https://codesandbox.io/s/r4mn0yj6po
What is the expected behavior?
That the touchmove and touchend events are published
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
Reproduced bug in Firefox and Chrome
React version: tested on 16.1, 16.3 and 16.4.1