Skip to content

[web] Material ToolTip non-zero hover delay #141644

@ChristianEdwardPadilla

Description

@ChristianEdwardPadilla

Steps to reproduce

  1. Open the sample app code (below) in a DartPad.
  2. Hover over one of the buttons until the tooltip appears.
  3. Move to another button and observe a small delay before the new tooltip appears.

Expected results

When moving between two tooltip-containing widgets the newest tooltip should appear without delay. (The Material spec - https://m3.material.io/components/tooltips/guidelines - doesn't actually specify this, but it seems to be the most common behavior among Material implementations).

Actual results

There is a slight delay before the newest tooltip appears.

Code sample

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

const Color darkBlue = Color.fromARGB(255, 18, 32, 47);

void main() {
  runApp(TooltipExampleApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: Theme.of(context).copyWith(
        tooltipTheme: TooltipTheme.of(context).copyWith(
          waitDuration: Durations.medium1,
        ),
      ),
      home: Scaffold(
        appBar: AppBar(title: const Text('Tooltip Sample')),
        body: const Center(
          child: TooltipSample(),
        ),
      ),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Row(
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
      IconButton(
        icon: Icon(Icons.add_location),
        tooltip: 'Add location',
        onPressed: () {},
      ),
      IconButton(
        icon: Icon(Icons.add_a_photo),
        tooltip: 'Add photo',
        onPressed: () {},
      ),
      IconButton(
        icon: Icon(Icons.add_task),
        tooltip: 'Add task',
        onPressed: () {},
      ),
    ],);
  }
}

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

Doctor output
Latest DartPad version

Metadata

Metadata

Assignees

No one assigned

    Labels

    f: material designflutter/packages/flutter/material repository.found in release: 3.16Found to occur in 3.16found in release: 3.19Found to occur in 3.19frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions