Repository navigation
Description
Steps to reproduce
- Run an app with an icon-only
IconButtonthat has atooltip, for example anAppBarwith its automaticBackButton, or openshowDatePicker. - Keep the mouse away from the buttons.
- 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
flutter-zl commentedon Nov 20, 2026
Fixed by flutter/packages#13657, which included the
showOnFocuschange from flutter/packages#13654.TooltipandTooltipThemeDatanow have an opt-inshowOnFocusin material_ui.