Skip to content

Chrome 56 breaks touch events #8968

@mstijak

Description

@mstijak

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions