Skip to content

Scrollbar of MenuAnchor works incorrectly #188155

Closed
flutter/packages
#12470

Description

@cuong1112035

Steps to reproduce

  1. run my attached example code below
  2. tap on Open Menu button
  3. scroll the displayed menus list all the way down the bottom

Expected results

the Scrollbar of MenuAnchor scrolls to its bottom when I scroll the menu items list to its end

Actual results

the Scrollbar of MenuAnchor get stuck

Code sample

Code sample
import 'package:flutter/material.dart';


void main() => runApp(const MyApp());

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: MenuControllerPage(),
    );
  }
}

class MenuControllerPage extends StatefulWidget {
  const MenuControllerPage({super.key});

  @override
  State<MenuControllerPage> createState() => _MenuControllerPageState();
}

class _MenuControllerPageState extends State<MenuControllerPage> {
  final MenuController _menuController = MenuController();
  final ScrollController _scrollController = ScrollController();

  @override
  void dispose() {
    _scrollController.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('MenuController Demo')),
      body: Center(
        child: Column(
          mainAxisSize: MainAxisSize.min,
          children: [
            MenuAnchor(
              controller: _menuController,
              style: const MenuStyle(
                maximumSize: WidgetStatePropertyAll(Size.fromHeight(100)),
              ),
              menuChildren: [
                MenuItemButton(
                  onPressed: () {},
                  child: const Text('Demo 0'),
                ),
                MenuItemButton(
                  onPressed: () {},
                  child: const Text('Demo 1'),
                ),
                MenuItemButton(
                  onPressed: () {},
                  child: const Text('Demo 2'),
                ),
                MenuItemButton(
                  onPressed: () {},
                  child: const Text('Demo end'),
                ),
              ],
              builder: (context, controller, child) {
                return ElevatedButton(
                  onPressed: () {
                    if (controller.isOpen) {
                      controller.close();
                    } else {
                      controller.open();
                    }
                    setState(() {});
                  },
                  child: Text(
                    controller.isOpen
                        ? 'Close Menu'
                        : 'Open Menu',
                  ),
                );
              },
            ),
          ],
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration Image

Flutter Doctor output

Doctor output
➜  0 app flutter doctor -v
[✓] Flutter (Channel stable, 3.44.2, on macOS 15.5 24F74 darwin-arm64, locale en-VN) [474ms]
    • Flutter version 3.44.2 on channel stable at /Applications/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c9a6c48423 (7 days ago), 2026-06-10 15:52:41 -0700
    • Engine revision 77e2e94772
    • Dart version 3.12.2
    • DevTools version 2.57.0
    • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios,
      cli-animations, enable-native-assets, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging,
      enable-uiscene-migration

[✓] Android toolchain - develop for Android devices (Android SDK version 36.0.0) [1,794ms]
    • Android SDK at /Users/nguyencuong/Library/Android/sdk
    • Emulator version 36.2.12.0 (build_id 14214601) (CL:N/A)
    • Platform android-36, build-tools 36.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
      This is the JDK bundled with the latest Android Studio installation on this machine.
      To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 21.0.8+-14018985-b1038.68)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 16.4) [1,397ms]
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 16F6
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web [6ms]
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Connected device (3 available) [6.6s]
    • sdk gphone16k arm64 (mobile) • emulator-5554 • android-arm64  • Android 17 (API 37) (emulator)
    • macOS (desktop)              • macos         • darwin-arm64   • macOS 15.5 24F74 darwin-arm64
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 149.0.7827.155
    ! Error: Browsing on the local area network for Cuong’s iPhone (2). Ensure the device is unlocked and attached with a cable
      or associated with the same local area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)

[✓] Network resources [651ms]
    • All expected network resources are available.

• No issues found!

Activity

  1. suryaKommana2662 commented on Jun 18, 2026

    @suryaKommana2662
    Contributor

    @cuong1112035 Thank you for the report. I tested the provided sample on both an Android emulator and a physical Android device, but I was unable to reproduce the reported scrollbar behavior.
    Could you please specify the platform where you are seeing this issue (Android, iOS). also, please provide a screen recording demonstrating the issue and the steps leading up to it. This will help us better understand the behavior and investigate further.

    Output:

    [√] Flutter (Channel stable, 3.44.2, on Microsoft Windows [Version 10.0.26200.8457], locale en-IN) [715ms]
        • Flutter version 3.44.2 on channel stable at C:\flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision c9a6c48423 (7 days ago), 2026-06-10 15:52:41 -0700
        • Engine revision 77e2e94772
        • Dart version 3.12.2
        • DevTools version 2.57.0
        • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios,
          cli-animations, enable-native-assets, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging,
          enable-uiscene-migration
    
    [√] Windows Version (Windows 11 or higher, 25H2, 2009) [1,646ms]
    
    [√] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [9.5s]
        • Android SDK at C:\Android\Sdk
        • Emulator version 36.5.11.0 (build_id 15261927) (CL:N/A)
        • Platform android-36.1, build-tools 36.1.0
        • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
          This is the JDK bundled with the latest Android Studio installation on this machine.
          To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
        • Java version OpenJDK Runtime Environment (build 21.0.10+-14961533-b1163.108)
        • All Android licenses accepted.
    
    [√] Chrome - develop for the web [255ms]
        • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
    
    [√] Visual Studio - develop Windows apps (Visual Studio Community 2026 18.6.1) [253ms]
        • Visual Studio at C:\Program Files\Microsoft Visual Studio\18\Community
        • Visual Studio Community 2026 version 18.6.11819.183
        • Windows 10 SDK version 10.0.26100.0
    
    [√] Connected device (5 available) [947ms]
        • motorola edge 40 neo (mobile) • ZD222K8SW3    • android-arm64  • Android 15 (API 35)
        • sdk gphone16k x86 64 (mobile) • emulator-5554 • android-x64    • Android 17 (API 37) (emulator)
        • Windows (desktop)             • windows       • windows-x64    • Microsoft Windows [Version 10.0.26200.8457]
        • Chrome (web)                  • chrome        • web-javascript • Google Chrome 149.0.7827.103
        • Edge (web)                    • edge          • web-javascript • Microsoft Edge 149.0.4022.69
    
    [√] Network resources [1,672ms]
        • All expected network resources are available.
    
    • No issues found!
  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    and removed
    in triagePresently being triaged by the triage team
    on Jun 18, 2026
  3. cuong1112035 commented on Jul 6, 2026

    @cuong1112035
    Author

    Could you please specify the platform where you are seeing this issue (Android, iOS)
    I'm using android emulator(Pixel 9a)
    please provide a screen recording demonstrating the issue and the steps leading up to it
    video: https://photos.app.goo.gl/xA1TXbXenKWXksMaA
    Image
    steps:

    1. run code:
    import 'package:flutter/material.dart';
    
    
    void main() => runApp(const MyApp());
    
    class MyApp extends StatelessWidget {
      const MyApp({super.key});
    
      @override
      Widget build(BuildContext context) {
        return const MaterialApp(
          home: MenuControllerPage(),
        );
      }
    }
    
    class MenuControllerPage extends StatefulWidget {
      const MenuControllerPage({super.key});
    
      @override
      State<MenuControllerPage> createState() => _MenuControllerPageState();
    }
    
    class _MenuControllerPageState extends State<MenuControllerPage> {
      final MenuController _menuController = MenuController();
    
      @override
      Widget build(BuildContext context) {
        return Scaffold(
          appBar: AppBar(title: const Text('MenuController Demo')),
          body: Center(
            child: Column(
              mainAxisSize: MainAxisSize.min,
              children: [
                MenuAnchor(
                  controller: _menuController,
                  style: const MenuStyle(
                    maximumSize: WidgetStatePropertyAll(Size.fromHeight(100)),
                  ),
                  menuChildren: [
                    MenuItemButton(
                      onPressed: () {},
                      child: const Text('Demo 0'),
                    ),
                    MenuItemButton(
                      onPressed: () {},
                      child: const Text('Demo 1'),
                    ),
                    MenuItemButton(
                      onPressed: () {},
                      child: const Text('Demo 2'),
                    ),
                    MenuItemButton(
                      onPressed: () {},
                      child: const Text('Demo end'),
                    ),
                  ],
                  builder: (context, controller, child) {
                    return ElevatedButton(
                      onPressed: () {
                        if (controller.isOpen) {
                          controller.close();
                        } else {
                          controller.open();
                        }
                        setState(() {});
                      },
                      child: Text(
                        controller.isOpen
                            ? 'Close Menu'
                            : 'Open Menu',
                      ),
                    );
                  },
                ),
              ],
            ),
          ),
        );
      }
    }
    
    1. tap on "Open Menu" button
    2. scroll the items list to its end
      @suryaKommana2662
  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jul 6, 2026
  5. suryaKommana2662 commented on Jul 6, 2026

    @suryaKommana2662
    Contributor

    @cuong1112035 Thanks for providing the additional information and screen recording. I was able to reproduce the issue using the provided sample on an Android emulator(Android 17 (API 37)) running the current stable Flutter release. When scrolling the menu items to the end, the scrollbar does not reach the bottom as expected. Routing to the team-android for further investigation.

    Flutter Doctor Output

    [√] Flutter (Channel stable, 3.44.4, on Microsoft Windows [Version 10.0.26200.8655], locale en-IN) [535ms]
        • Flutter version 3.44.4 on channel stable at C:\flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision ad70ec4617 (12 days ago), 2026-06-24 11:07:06 -0700
        • Engine revision a10d8ac38d
        • Dart version 3.12.2
        • DevTools version 2.57.0
        • Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios,
          cli-animations, enable-native-assets, enable-swift-package-manager, omit-legacy-version-file, enable-lldb-debugging,
          enable-uiscene-migration
    
    [√] Windows Version (Windows 11 or higher, 25H2, 2009) [2.3s]
    
    [√] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [4.5s]
        • Android SDK at C:\Android\Sdk
        • Emulator version 36.5.11.0 (build_id 15261927) (CL:N/A)
        • Platform android-36.1, build-tools 36.1.0
        • Java binary at: C:\Program Files\Android\Android Studio\jbr\bin\java
          This is the JDK bundled with the latest Android Studio installation on this machine.
          To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
        • Java version OpenJDK Runtime Environment (build 21.0.10+-14961533-b1163.108)
        • All Android licenses accepted.
    
    [√] Chrome - develop for the web [162ms]
        • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
    
    [√] Visual Studio - develop Windows apps (Visual Studio Community 2026 18.6.1) [160ms]
        • Visual Studio at C:\Program Files\Microsoft Visual Studio\18\Community
        • Visual Studio Community 2026 version 18.6.11819.183
        • Windows 10 SDK version 10.0.26100.0
    
    [√] Connected device (4 available) [780ms]
        • sdk gphone16k x86 64 (mobile) • emulator-5554 • android-x64    • Android 17 (API 37) (emulator)
        • Windows (desktop)             • windows       • windows-x64    • Microsoft Windows [Version 10.0.26200.8655]
        • Chrome (web)                  • chrome        • web-javascript • Google Chrome 149.0.7827.201
        • Edge (web)                    • edge          • web-javascript • Microsoft Edge 149.0.4022.80
    
    [√] Network resources [1,335ms]
        • All expected network resources are available.
  6. added
    platform-androidAndroid applications specifically
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    team-androidOwned by Android platform team
    and removed
    in triagePresently being triaged by the triage team
    on Jul 6, 2026
  7. added and removed
    team-androidOwned by Android platform team
    on Jul 7, 2026
  8. added
    P2Important issues not at the top of the work list
    on Jul 7, 2026
  9. added
    packageflutter/packages repository. See also p: labels.
    and removed
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Aug 17, 2026
  10. added
    team-designOwned by Design Languages team
    triaged-designTriaged by Design Languages team
    and removed on Aug 26, 2026
  11. added a commit that references this issue on Oct 22, 2026
    95c83e5
  12. github-actions commented on Nov 5, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  13. locked as resolved and limited conversation to collaborators on Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listhas reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions