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

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

Closed

Description

@vbraun

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)

Activity

  1. added
    a11yThis issue is related to accessibility
    on Aug 7, 2019
  2. self-assigned this
    on Aug 7, 2019
  3. added this to the 1.1.21 milestone on Aug 7, 2019
  4. changed the title [-]Infinite recursion in GestureHandler.end() with android talkback[/-] [+]gesture: infinite recursion in GestureHandler.end() with Android TalkBack[/+] on Aug 7, 2019
  5. added
    os: AndroidThe issue is specific to the Android OS.
    P1: urgentUrgent issues that should be addressed in the next minor or patch release.
    needs: investigationThe cause of this issue is not well understood and needs to be investigated by the team or community
    on Aug 7, 2019
  6. Splaktar commented on Aug 12, 2019

    @Splaktar
    Contributor

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

  7. Splaktar commented on Aug 13, 2019

    @Splaktar
    Contributor

    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...

  8. added a commit that references this issue on Aug 13, 2019
    bf20961
  9. added
    has: Pull RequestA PR has been created to address this issue
    and removed
    needs: investigationThe cause of this issue is not well understood and needs to be investigated by the team or community
    on Aug 13, 2019
  10. modified the milestones: 1.1.21, 1.1.20 on Aug 13, 2019
  11. Splaktar commented on Aug 13, 2019

    @Splaktar
    Contributor

    PR #11774 posted to fix this.

  12. added a commit that references this issue on Aug 13, 2019
    4acef53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1: urgentUrgent issues that should be addressed in the next minor or patch release.a11yThis issue is related to accessibilityhas: Pull RequestA PR has been created to address this issueos: AndroidThe issue is specific to the Android OS.resolution: fixedtype: bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions