Skip to content

Tooltip does not show on keyboard focus #196554

Closed

Description

@flutter-zl

Steps to reproduce

  1. Run an app with an icon-only IconButton that has a tooltip, for example an AppBar with its automatic BackButton, or open showDatePicker.
  2. Keep the mouse away from the buttons.
  3. Press Tab until the icon button has keyboard focus.

Expected results

The tooltip text, for example "Back", "Previous month" or "Open navigation menu", becomes visible while the button has keyboard focus, so sighted keyboard users can learn what an icon-only control does. It should hide when focus moves on and be dismissible with Escape.

Actual results

Only the focus highlight appears. Tooltip opens on mouse hover, long press or tap, depending on triggerMode, or when ensureTooltipVisible() is called, but never on keyboard focus. Screen readers already announce the tooltip text, so the gap is for sighted keyboard users.

Code sample

import 'package:flutter/material.dart';

void main() => runApp(const MaterialApp(home: Home()));

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Tooltip on focus'),
        actions: <Widget>[
          IconButton(
            tooltip: 'Go to the next page',
            icon: const Icon(Icons.navigate_next),
            onPressed: () {},
          ),
        ],
      ),
      body: Center(
        child: ElevatedButton(
          onPressed: () => showDatePicker(
            context: context,
            firstDate: DateTime(2000),
            lastDate: DateTime(2100),
          ),
          child: const Text('Show Date Picker'),
        ),
      ),
    );
  }
}

Notes

Showing tooltips on focus by default is risky on mobile and TV, because any hardware key, including an Android TV D-pad, switches FocusManager.highlightMode to traditional. An opt-in on Tooltip and TooltipThemeData avoids changing existing apps.

Flutter Doctor output

Reproduces on current master with package:flutter/material.dart and package:material_ui, on web, desktop and any platform with a keyboard.

Activity

  1. self-assigned this
    on Nov 13, 2026
  2. added
    framework
    a: accessibility
    team-web
    P1
    triaged-web
    and removed
    a: accessibility
    on Nov 13, 2026
  3. flutter-zl commented on Nov 20, 2026

    @flutter-zl
    ContributorAuthor

    Fixed by flutter/packages#13657, which included the showOnFocus change from flutter/packages#13654. Tooltip and TooltipThemeData now have an opt-in showOnFocus in material_ui.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1f: material designframeworkteam-webtriaged-web

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions