-
Notifications
You must be signed in to change notification settings - Fork 49.3k
Description
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
React attaches events to the document
node which causes the latest version of Chrome to issue the following warning.
Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080
It appears that Chrome now treats all document level touch events as passive.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar (template: https://jsfiddle.net/reactjs/69z2wepo/).
class App extends Component {
render() {
return (
<div
className="box"
onTouchStart={e=>{e.preventDefault()}}
onTouchMove={e=>{e.preventDefault()}}
>
Drag Me
</div>
);
}
}
What is the expected behavior?
preventDefault
should be allowed, which means React should pass { passive: false }
when adding event listeners.
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React 15.4.1, Chrome 56.0.2924.87, Windows 10