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

chrome, doesn't accept preventDefault and still cancelable is true #579

Closed
Nadya678 opened this issue Feb 25, 2018 · 3 comments
Closed

chrome, doesn't accept preventDefault and still cancelable is true #579

Nadya678 opened this issue Feb 25, 2018 · 3 comments

Comments

@Nadya678
Copy link

Chrome cannot preventDefault on the #document, <body/> and <html/> objects. The cancelable is still true. The warnings and access violation should be reported IMO if cancelable is false.

TouchEvent 
{
altKey:false
bubbles:true
cancelBubble:false
cancelable:true
changedTouches:TouchList {0: Touch, length: 1}
composed:true
ctrlKey:false
(...)
}

[Intervention] Unable to preventDefault inside passive event listener due to target being treated as passive. See https://www.chromestatus.com/features/5093566007214080

IMO if any browser "improve scrolling" and other make extensions, the event should have set cancelable to false due to specification.

After setting touch-action:none the warning is not emitted but still the event is not cancelled by use od preventDefault and stopPropagation.

@Nadya678 Nadya678 changed the title chrome, doesn't accept preventDefault and stil cancelable is true chrome, doesn't accept preventDefault and still cancelable is true Feb 25, 2018
@annevk
Copy link
Member

annevk commented Feb 26, 2018

I recommend filing a bug against Chrome or maybe https://github.com/WICG/interventions/. This isn't really defined behavior.

@annevk annevk closed this as completed Feb 26, 2018
@Nadya678
Copy link
Author

Nadya678 commented Feb 27, 2018

@annevk This is not true.

cancelable of type boolean, readonly Used to indicate whether or not an event can have its default action prevented. If the default action can be prevented the value is true, else the value is false.

https://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html#Events-Event-canCancel

@annevk
Copy link
Member

annevk commented Feb 27, 2018

That definition is no longer entirely accurate, but it doesn't matter, since you're complaining about behavior specific to Chrome, not something that's in the DOM Standard: https://dom.spec.whatwg.org/.

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

No branches or pull requests

2 participants