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

check for event.cancelable in touch events #12121

Merged
merged 2 commits into from
Jul 28, 2022
Merged

Conversation

jschaf
Copy link
Contributor

@jschaf jschaf commented Jul 28, 2022

Chrome has started warning when canceling an event that cannot be cancelled, like scrolling.
This causes a fair bit of log spam. I know it fires for touchmove and touchend and there's
reports that it also fires for touchstart.

IgnoredEventCancel: intervention: Ignored attempt to cancel a touchmove event with
cancelable=false, for example because scrolling is in progress and cannot be interrupted

References:

Fixes #11961.

<changelog>Fix Chrome console warnings about ignored event cancel on touch interactions</changelog>

Chrome has started warning when canceling an event that cannot be cancelled, like scrolling.
This causes a fair bit of log spam. I know it fires for touchmove and touchend and there's 
reports that it also fires for touchstart.

    IgnoredEventCancel: intervention: Ignored attempt to cancel a touchmove event with
    cancelable=false, for example because scrolling is in progress and cannot be interrupted

References:

- react-grid-layout/react-draggable#553
- https://www.uriports.com/blog/easy-fix-for-intervention-ignored-attempt-to-cancel-a-touchmove-event-with-cancelable-false/
- FL3NKEY/scroll-lock#19
- https://stackoverflow.com/a/53315365/30900

Fixes mapbox#11961.
@CLAassistant
Copy link

CLAassistant commented Jul 28, 2022

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@mourner mourner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks for the fix! This looks good apart from the failing lint check due to identation.

src/ui/handler/touch_pan.js Outdated Show resolved Hide resolved
Co-authored-by: Volodymyr Agafonkin <agafonkin@gmail.com>
@jschaf
Copy link
Contributor Author

jschaf commented Jul 28, 2022

Good catch, thanks for the fix! This looks good apart from the failing lint check due to identation.

Thanks, applied your suggestion.

@jschaf jschaf requested a review from mourner July 28, 2022 18:24
@mourner mourner merged commit 5769fa1 into mapbox:main Jul 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants