Skip to content

Tooltip interrupts widget interactivity #161169

Closed as not planned
Closed as not planned

Description

@benji-farquhar

Given the Tooltip docs:

Tooltips provide text labels which help explain the function of a button or other user interface action

They are to make the app easier to use, but they can make it harder to use if the user's mouse happens to land on the tooltip, causing all interactions to stop working. Ideally it would describe the functionality without negatively impacting the interactivity.

Steps to reproduce

  1. Have a clickable and hoverable item big enough to show the tooltip over the item.
  2. Hover over the tooltip on the item on web.
  3. Click on, and hover the tooltip

Expected results

The clickable item click event executes, and onHover effects show

Actual results

The tooltip absorbs the clickable item's click event and hover event. No click or hover event is triggered.

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: 'Flutter Demo',
      theme: ThemeData(
        tooltipTheme: TooltipThemeData(triggerMode: TooltipTriggerMode.tap),
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            SizedBox(
              width: 100,
              height: 100,
              child: Tooltip(
                message: 'Increment',
                child: InkWell(
                  onTap: _incrementCounter,
                  child: Container(
                    color: Colors.purple,
                    child: const Icon(Icons.add),
                  ),
                ),
              ),
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headlineMedium,
            ),
          ],
        ),
      ),
    );
  }
}

Screenshots or Video

Screen.Recording.2025-01-07.at.5.23.22.am.mov

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.27.1, on macOS 15.1.1 24B91 darwin-arm64, locale en-GB)
    • Flutter version 3.27.1 on channel stable at /Users/benjaminfarquhar/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 17025dd882 (3 weeks ago), 2024-12-17 03:23:09 +0900
    • Engine revision cb4b5fff73
    • Dart version 3.6.0
    • DevTools version 2.40.2

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/benjaminfarquhar/Library/Android/sdk
    • Platform android-35, build-tools 34.0.0
    • ANDROID_HOME = /Users/benjaminfarquhar/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.10+0-17.0.10b1087.21-11609105)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 2024.1)
    • 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 17.0.10+0-17.0.10b1087.21-11609105)

[✓] IntelliJ IDEA Community Edition (version 2024.2.1)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • 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

[✓] VS Code (version 1.96.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.102.0

[✓] Connected device (7 available)
    • sdk gphone64 arm64 (mobile)     • emulator-5554                        • android-arm64  • Android 14 (API 34) (emulator)
    • Benji’s iPhone 13 mini (mobile) • 00008110-001119123C7B801E            • ios            • iOS 18.1.1 22B91
    • iPad Pro 11-inch (M4) (mobile)  • 2DBCFED4-D6AE-4FAB-B86A-12CCF187513C • ios            • com.apple.CoreSimulator.SimRuntime.iOS-18-2 (simulator)
    • iPad Pro 13-inch (M4) (mobile)  • 0C0766EB-5379-4B6A-8A13-76B74049B8AB • ios            • com.apple.CoreSimulator.SimRuntime.iOS-18-2 (simulator)
    • macOS (desktop)                 • macos                                • darwin-arm64   • macOS 15.1.1 24B91 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad                • darwin         • macOS 15.1.1 24B91 darwin-arm64
    • Chrome (web)                    • chrome                               • web-javascript • Google Chrome 131.0.6778.205

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

• No issues found!

Activity

  1. changed the title [-]Tooltip interrupts widget interactivity[/-] [+][Web] Tooltip interrupts widget interactivity[/+] on Jan 7, 2025
  2. added
    in triage
    on Jan 7, 2025
  3. changed the title [-][Web] Tooltip interrupts widget interactivity[/-] [+]\Tooltip interrupts widget interactivity[/+] on Jan 7, 2025
  4. changed the title [-]\Tooltip interrupts widget interactivity[/-] [+]Tooltip interrupts widget interactivity[/+] on Jan 7, 2025
  5. danagbemava-nc commented on Jan 7, 2025

    @danagbemava-nc
    Member

    Reproduces with the sample provided above. This is not specific to web, it happens on macOS as well.

    Labeling for further investigation.

    Screen.Recording.2025-01-07.at.10.39.52.AM.mov

    Maybe related #142465

    flutter doctor -v
    [✓] Flutter (Channel stable, 3.27.1, on macOS 15.1.1 24B91 darwin-arm64, locale en-US)
        • Flutter version 3.27.1 on channel stable at /Users/deanli/dev/stable
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 17025dd882 (3 weeks ago), 2024-12-17 03:23:09 +0900
        • Engine revision cb4b5fff73
        • Dart version 3.6.0
        • DevTools version 2.40.2
    
    [!] Flutter (Channel master, 3.28.0-2.0.pre.38618, on macOS 15.1.1 24B91 darwin-arm64, locale en-US)
        • Flutter version 3.28.0-2.0.pre.38618 on channel master at /Users/deanli/dev/master
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision cda3515126 (7 hours ago), 2025-01-06 19:37:36 -0800
        • Engine revision cda3515126
        • Dart version 3.7.0 (build 3.7.0-267.0.dev)
        • DevTools version 2.41.0
    
    
  6. added
    p: material_ui
    framework
    has reproducible steps
    team-design
    found in release: 3.27
    found in release: 3.28
    and removed
    in triage
    on Jan 7, 2025
  7. TahaTesser commented on Jan 7, 2025

    @TahaTesser
    Contributor

    This is same as #142465. Anyone want to file a PR. please see #142465 (comment)

  8. added
    r: duplicate
    on Jan 7, 2025
  9. github-actions commented on Jan 21, 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.

  10. locked as resolved and limited conversation to collaborators on Jan 21, 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

    found in release: 3.27found in release: 3.28frameworkhas reproducible stepsp: material_uir: duplicateteam-design

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions