New issue
Advanced search Search tips

Issue 652519 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Oct 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

target treated as passive for listeners on `touchstart, touchmove, touchend`

Project Member Reported by valdrin@google.com, Oct 4 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2879.0 Safari/537.36

Example URL:

Steps to reproduce the problem:
1. add event listener for 'touchstart, touchmove' or 'touchend'
2. prevent default behavior on callback
3. trigger the event

document.addEventListener('touchstart', function(event) {
  event.preventDefault();
});
document.dispatchEvent(new CustomEvent('touchstart', {
  bubbles: true,
  cancelable: true
}));

What is the expected behavior?
event listener is not passive, so event default can be prevented.

What went wrong?
event listener is defaulted to passive: true, so i get the error: Unable to preventDefault inside passive event listener due to target being treated as passive.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? Yes chrome 53.0.2785.116 (Official Build) (64-bit)

Does this work in other browsers? Yes 

Chrome version: 55.0.2879.0  Channel: canary
OS Version: OS X 10.11.6
Flash Version: Shockwave Flash 23.0 r0
 
Components: -Blink Blink>Input
Project Member

Comment 2 by sheriffbot@chromium.org, Oct 4 2016

Labels: Hotlist-Google
Cc: dtapu...@chromium.org rbyers@chromium.org
Status: WontFix (was: Unconfirmed)
touch events that are registered on the document are treated as passive. This is an user agent intervention that we are pushing to release in beta and stable.

More details are going to be published on the dev blog eventually when we goto ship it.

You should be using either of these:
1) touch-action
2) pointer-events
3) passive: false (if you really need behavior that isn't covered in the above two)


Only touchstart and touchmove, right?  touchend should be unaffected (important for suppressing click etc.).

Comment 6 by valdrin@google.com, Oct 4 2016

Correct, touchend is not affected.
I need to preventDefault touchstart and touchmove events in order to disable scrolling when it happens outside a certain node in iron-dropdown, see https://github.com/PolymerElements/iron-dropdown/blob/master/iron-dropdown-scroll-manager.html
Would love to use the passive: true & benefit from it, but I don't have other solutions for blocking the scrolling.

Sign in to add a comment