Skip to content

Page scrolling is impossible when the cursor hits a Tooltip in the web #167042

Closed

Description

@khlebobul

Steps to reproduce

  1. Create a list of items, e.g. via ListView
  2. Add a Tooltip to each element
  3. Start scrolling with the cursor on the Tooltip area in the Web

Expected results

Fluent scrolling with Tooltip appearing for each item without stopping to scroll. You get this behavior if you perform scrolling outside of elements.

Screen.Recording.2025-04-12.at.21.34.44.mov

Actual results

Unpredictable stop scrolling when the cursor hits the Tooltip. It's hard to tell from the video, it's better to reproduce in person.

Screen.Recording.2025-04-12.at.21.36.14.mov

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 MaterialApp(
      title: 'Tooltip List Example',
      home: const TooltipListPage(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('List with Tooltips')),
      body: ListView.builder(
        itemCount: 50,
        itemBuilder: (context, index) {
          return Tooltip(
            showDuration: const Duration(seconds: 1),
            message: 'This is item #${index + 1}',
            child: ListTile(title: Center(child: Text('Item ${index + 1}'))),
          );
        },
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.29.2, on macOS 15.1.1 24B91 darwin-arm64, locale en-RU) [1,435ms]
    • Flutter version 3.29.2 on channel stable at /Users/glebshalimov/Code/sdks/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision c236373904 (4 weeks ago), 2025-03-13 16:17:06 -0400
    • Engine revision 18b71d647a
    • Dart version 3.7.2
    • DevTools version 2.42.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [3.0s]
    • Android SDK at /Users/glebshalimov/Library/Android/sdk
    • Platform android-35, build-tools 34.0.0
    • Java binary at: /Library/Java/JavaVirtualMachines/liberica-jdk-19-full.jdk/Contents/Home/bin/java
      This JDK is specified in your Flutter configuration.
      To change the current JDK, run: `flutter config --jdk-dir="path/to/jdk"`.
    • Java version OpenJDK Runtime Environment (build 19.0.2+9)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 2024.3) [11ms]
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.5+-12932927-b750.29)

[✓] VS Code (version 1.99.2) [9ms]
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.108.0

Activity

  1. Hamed233 commented on Apr 12, 2025

    @Hamed233

    I'm working on fixing this issue. The problem occurs because the Tooltip's MouseRegion is blocking scroll events. I've implemented a fix that:

    1. Changes the Listener's HitTestBehavior from opaque to translucent
    2. Modifies _ExclusiveMouseRegion to only handle mouse enter/exit events
    3. Allows scroll events to pass through while maintaining tooltip functionality

    I'm currently testing the changes and will submit a PR soon.

  2. khlebobul commented on Apr 12, 2025

    @khlebobul
    Author

    Thank you very much

  3. added
    in triage
    on Apr 14, 2025
  4. darshankawar commented on Apr 14, 2025

    @darshankawar
    Member

    @khlebobul
    I am unable to replicate this on web and also checked on desktop. I tried with trackpad scrolling and mouse scrolling but was unable to replicate. The scroll was smooth with both. Also, I observed that the mouse pointer couldn't properly get over the tooltip, unlike your video in actual results.
    The scroll was smooth Is it replicable with mouse or without mouse too ? I tried with latest master version.

  5. added
    waiting for response
    on Apr 14, 2025
  6. Hamed233 commented on Apr 14, 2025

    @Hamed233
    flutter_issue_scrolling.mp4
  7. khlebobul commented on Apr 14, 2025

    @khlebobul
    Author

    @Hamed233 thank you! @darshankawar, that's exactly what's happening in the video ⬆️

  8. removed
    waiting for response
    on Apr 14, 2025
  9. darshankawar commented on Apr 15, 2025

    @darshankawar
    Member

    Thanks for the update and detailed video. I tried again but was unable to replicate, as I couldn't properly place the cursor exactly on top of the tooltip using mouse or trackpad, but based on the reported behavior and potential fix, I'll keep the issue open and label for team's tracking.

  10. added
    framework
    p: material_ui
    f: scrolling
    on Apr 15, 2025
  11. 5 remaining items

  12. added
    P2
    triaged-design
    on Apr 23, 2025
  13. duck-dev-go commented on Apr 25, 2025

    @duck-dev-go

    We are experiencing the same issue on Mac OS web.

  14. Piinks commented on May 1, 2025

    @Piinks
    Contributor

    Does using Tooltip.ignorePointer to false help with this?

  15. Hamed233 commented on May 1, 2025

    @Hamed233

    Hi @Piinks ,

    Thank you for your feedback on the PR. I've made the following changes to address your concerns:

    1. Fixed the test: I've completely rewritten the "Allow scroll events to pass through tooltips on web" test to be more reliable and provide better debugging information. The test now:

      • Uses a custom TouchAndMouseScrollBehavior to ensure both touch and mouse events can trigger scrolling
      • Properly verifies the initial widget position and scroll offset before testing
      • Uses the scroll controller to directly verify that scrolling occurred, rather than relying on widget positions that may be outside the viewport
      • Includes clear assertions with descriptive messages for better debugging
    2. Local testing: I've run the test locally multiple times and it passes consistently. The test verifies that scrolling works while a tooltip is active, which confirms the fix addresses the issue.

    3. Clean implementation: I've created a fresh branch from master and applied only the necessary changes to fix this specific issue.

    The test now provides clear debugging information and is much more robust - it no longer tries to find widgets that might be scrolled out of view, instead relying on the scroll controller's offset to verify scrolling occurred.

  16. Piinks commented on May 7, 2025

    @Piinks
    Contributor

    I also have not been able to reproduce this on the web on MacOS. The cursor is not easy to place on the tooltip, and it is positioned below the cursor. I was able to maneuver the cursor over the tooltip for a moment, but was still able to scroll.
    For those that have been able to reproduce this, can you please try with Tooltip.ignorePointer to set false and report back?

  17. khlebobul commented on May 8, 2025

    @khlebobul
    Author

    Hello @Piinks

    Thank you for your feedback, I just found this discussion. Do I understand correctly that you are talking about such an implementation ⬇️?

    return IgnorePointer(
                ignoring: false,
                child: Tooltip(
                  showDuration: const Duration(seconds: 1),
                  message: 'This is item #${index + 1}',
                  child: ListTile(title: Center(child: Text('Item ${index + 1}'))),
                ),
              );

    I still don't have a proper scroll anyway

  18. Piinks commented on May 8, 2025

    @Piinks
    Contributor

    No I was referring to Tooltip.ignorePointer, which was added in #161363
    I think this was fixed by that, it just has not reached the stable channel yet.

  19. dkwingsmt commented on May 9, 2025

    @dkwingsmt
    Contributor

    By adding verticalOffset: -10, to Tooltip, I managed to make the tooltip appear under my cursor. Even with this, I can't reproduce the issue at the current main (70619a15d0266d7e6a4b8eb471bc9eb947376f45).

    However, by switching to the revision right before #161363 (ccae8cc79480c854992cd093cf5b43bd4a9b50c9), I can reproduce the issue and see that the tooltip is blocking scrolls.

    The doctor log provided by the author noted version 3.29.2. #161363 is landed to stable at 3.30.

    I think this issue should have been fixed on the main channel, therefore I'm closing this issue. Please switch to the main channel, or (in the future) try with a stable version later than 3.29. Feel free to comment under this issue or open a new one if you find similar issues after so.

  20. khlebobul commented on May 10, 2025

    @khlebobul
    Author

    Hello, I updated the version and tried adding verticalOffset: -10. I don't consider this a solution to the issue, as there is still a position at which the scroll doesn't work properly.

  21. dkwingsmt commented on May 10, 2025

    @dkwingsmt
    Contributor

    I meant that the solution is to upgrade to the main channel, as a fix (#161363) has been landed. Once you've upgraded, you shouldn't need any extra offset for this issue to disappear.

    The offset was regarding an earlier comment that it was impossible to make the tooltip appear under the cursor for reproduction.

  22. added
    r: fixed
    on May 12, 2025
  23. github-actions commented on May 26, 2025

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

  24. locked as resolved and limited conversation to collaborators on May 26, 2025
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

    P2f: scrollingframeworkp: material_uiplatform-webr: fixedteam-designtriaged-design

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions