Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

gesture: infinite recursion in GestureHandler.end() with Android TalkBack #11768

Closed
vbraun opened this issue Aug 5, 2019 · 3 comments · Fixed by #11774
Closed

gesture: infinite recursion in GestureHandler.end() with Android TalkBack #11768

vbraun opened this issue Aug 5, 2019 · 3 comments · Fixed by #11774
Assignees
Labels
a11y This issue is related to accessibility has: Pull Request A PR has been created to address this issue os: Android The issue is specific to the Android OS. P1: urgent Urgent issues that should be addressed in the next minor or patch release. resolution: fixed type: bug
Milestone

Comments

@vbraun
Copy link

vbraun commented Aug 5, 2019

Bug

Clicking on a button with android talkback causes an infinite recusion when dispatching the event. Moreover, this ends up delivering the native event again after the exception.

The duplicate click event causes major breakage with talkback. For example, you can't open the sidebar menu dropdowns on https://material.angularjs.org as they open and then immediately close.

Detailed Reproduction Steps:

  1. Open https://material.angularjs.org/latest/demo/button on android with talkback enabled
  2. Attach remote debugger
  3. Click button

What is the expected behavior?

Button should be clicked once without js error

What is the current behavior?

Uncaught RangeError: Maximum call stack size exceeded.
    at GestureHandler.nativeDispatchEvent [as dispatchEvent] (angular-material.js:4131)
    at GestureHandler.onEnd (angular-material.js:3730)
    at GestureHandler.end (angular-material.js:4000)
    at runHandlers (angular-material.js:4241)
    at HTMLDocument.gestureEnd (angular-material.js:4292)
    at defaultHandlerWrapper (angular.js:3802)
    at HTMLDocument.eventHandler (angular.js:3790)
    at GestureHandler.nativeDispatchEvent [as dispatchEvent] (angular-material.js:4131)
    at GestureHandler.onEnd (angular-material.js:3730)
    at GestureHandler.end (angular-material.js:4000)

(note: this is the non-minified stacktrace for clarity)

Which versions of AngularJS, Material, OS, and browsers are affected?

Angularjs material 1.1.19
Android 9 (Pixel 3 XL)

@Splaktar Splaktar added the a11y This issue is related to accessibility label Aug 7, 2019
@Splaktar Splaktar self-assigned this Aug 7, 2019
@Splaktar Splaktar added this to the 1.1.21 milestone Aug 7, 2019
@Splaktar Splaktar changed the title Infinite recursion in GestureHandler.end() with android talkback gesture: infinite recursion in GestureHandler.end() with Android TalkBack Aug 7, 2019
@Splaktar Splaktar added os: Android The issue is specific to the Android OS. P1: urgent Urgent issues that should be addressed in the next minor or patch release. needs: investigation The cause of this issue is not well understood and needs to be investigated by the team or community type: bug labels Aug 7, 2019
@Splaktar
Copy link
Member

I've been able to reproduce this back to 1.1.5 and it's likely to have been an issue since even earlier.

@Splaktar
Copy link
Member

I've identified that this is caused by the final mouseup event re-firing infinite times due to click hijacking being enabled.

dispatchEvent:  mousedown
dispatchEvent:  $md.pressdown
dispatchEvent:  click
dispatchEvent:  focus
dispatchEvent:  mouseup
dispatchEvent:  $md.pressup
dispatchEvent:  mouseup x 48 -> Uncaught RangeError: Maximum call stack size exceeded.

If click hijacking is disabled via $mdGestureProvider.skipClickHijack();, then this does not occur and the only events re-fired from a button click are:

dispatchEvent:  $md.pressdown
dispatchEvent:  $md.pressup

I also have a fix for this that I'm still verifying...

Splaktar added a commit that referenced this issue Aug 13, 2019
stop click hijacking from entering an infinite event loop

Fixes #11768
@Splaktar Splaktar added has: Pull Request A PR has been created to address this issue and removed needs: investigation The cause of this issue is not well understood and needs to be investigated by the team or community labels Aug 13, 2019
@Splaktar Splaktar modified the milestones: 1.1.21, 1.1.20 Aug 13, 2019
@Splaktar
Copy link
Member

PR #11774 posted to fix this.

mmalerba pushed a commit that referenced this issue Aug 13, 2019
stop click hijacking from entering an infinite event loop

Fixes #11768
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a11y This issue is related to accessibility has: Pull Request A PR has been created to address this issue os: Android The issue is specific to the Android OS. P1: urgent Urgent issues that should be addressed in the next minor or patch release. resolution: fixed type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants