Skip to content

Unable to dismiss popup menu in specific iOS devices with voiceover #157376

Closed
@jacobsimionato

Description

@jacobsimionato

Copied from Google internal issue b/374241149. See this issue for more context, links, and repro video.

Unable to dismiss the popup menu by double tapping outside the menu in voice over mode in specific iOS devices.

PopupMenuButton pushes _PopupMenuRoute which extends PopupRoute which extends ModalRoute which uses for rendering the scrim.

The double tap to dismiss is handled by the ModalBarrier by calling Navigator.maybePop().

Issue: This particular call is getting stuck in some iPhones (Example: My test device is an iPhone XR with iOS version 15.5). I tested this in the Hello Flutter codelab app.

Upon further debugging, its getting stuck at exactly await lastEntry.route.willPop().

lastEntry.route here is _PopupMenuRoute.

Tracing the willPop() implementations using debug print statements, I observed the following:

  • _PopupMenuRoute does not have willPop() implementation.
  • PopupRoute does not have willPop() implementation.
  • ModalRoute's willPop() completes and calls super.willPop().
  • LocalHistoryRoute's willPop() completes and calls super.willPop().
  • ... no other implementations of willPop() in between.
  • Route's willPop() is called.
  • But apparently the last call is getting stuck for some reason because await lastEntry.route.willPop() is stuck without a return value here:
    if (await lastEntry.route.willPop() == RoutePopDisposition.doNotPop) {

Repro project

The bug can be reproduced in any flutter app with the following:

PopupMenuButton<int>(
  // Set tooltip to empty to prevent the screen reader announcing
  // 'show menu'.
  tooltip: '',
  itemBuilder: (context) {
    return [
      PopupMenuItem<int>(
        value: 1,
        child: Text('Item 1'),
      ),
      PopupMenuItem<int>(
        value: 2,
        child: Text('Item 2'),
      ),
      PopupMenuItem<int>(
        value: 3,
        child: Text('Item 3'),
      ),
    ];
  },
),

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)c: regressionIt was better in the past than it is nowcustomer: money (g3)f: material designflutter/packages/flutter/material repository.found in release: 3.27Found to occur in 3.27frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyplatform-iosiOS applications specificallyteam-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)triaged-accessibilityTriaged by Framework Accessibility teamwaiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter responds

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions