Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

Do not execute event handler if not enabled and event type is touchca… #1079

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

syranez
Copy link

@syranez syranez commented Aug 30, 2016

…ncel.

handleEvent registers event listeners for the various touch events: touchstart, touchmove, touchend AND touchcancel.

Event listeners check the state of IScroll and the event type and decide if they can run:

  if ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {
      return;
  }

this.enabled ist set to true in the construct method IScroll.
utils.eventType is undefined for e.type === "touchcancel", as is this.initiated if you are scrolling outside your wrapper and _start was not executed.

Both expressions evaluate to false and thus the event listeners execute.

(SEO: Found the problem on Android 4.4.2 Webview, which emits touchcancel events)

…ncel.

handleEvent registers event listeners for the various touch events: touchstart, touchmove, touchend AND touchcancel.

Event listeners check the state of IScroll and the event type and decide if they can run:

> 		if ( !this.enabled || utils.eventType[e.type] !== this.initiated ) {
>			return;
>		}

this.enabled ist set to true in the construct method IScroll.
utils.eventType is undefined for e.type === "touchcancel", as is this.initiated if you are scrolling outside your wrapper and _start was not executed.

Both expressions evaluate to false and thus the event listeners execute.

(SEO: Found the problem on Android 4.4.2 Webview, which emits touchcancel events)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant