Repository navigation
Description
Steps to reproduce
Hello!
When using the Autocomplete widget, the keyboard navigation using TAB is sometimes blocked. It seems to only be an issue if the next widget is disabled.
Here's the Flutter version I use:
Flutter 3.41.4 • channel stable • https://github.com/flutter/flutter.git Framework • revision ff37bef603 (7 days ago) • 2026-03-03 16:03:22 -0800 Engine • hash 99578ad0355da00edb26301c874a3c250a5716f5 (revision e4b8dca3f1) (6 days ago) • 2026-03-03 18:24:54.000Z Tools • Dart 3.11.1 • DevTools 2.54.1
Expected results
The expected behavior appears only when the next widget is enabled. Pressing TAB should navigate to the next enabled widget:
Actual results
The issue seems to only appear when the next widget is disabled. In this case, pressing TAB does not navigate to the next enabled widget; the user is stucked inside the autocomplete:
Code sample
Code sample
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
class MeasuringUnitDTO {
MeasuringUnitDTO({required this.id, this.description});
String id;
String? description;
}
class UnitsOfMeasureAutocomplete extends StatelessWidget {
const UnitsOfMeasureAutocomplete({
super.key,
required this.unitOfMeasureCode,
this.onSelectionChanged,
});
final String? unitOfMeasureCode;
final void Function(MeasuringUnitDTO?)? onSelectionChanged;
@override
Widget build(BuildContext context) {
final unitsOfMeasure = [
MeasuringUnitDTO(id: 'KG', description: 'Kilogram'),
MeasuringUnitDTO(id: 'L', description: 'Liter'),
MeasuringUnitDTO(id: 'M', description: 'Meter'),
MeasuringUnitDTO(id: 'PCS', description: 'Pieces'),
MeasuringUnitDTO(id: 'BOX', description: 'Box'),
];
return Autocomplete<MeasuringUnitDTO>(
displayStringForOption: (option) => option.id,
onSelected: (selectedOption) => onSelectionChanged?.call(selectedOption),
optionsBuilder: (textEditingValue) => unitsOfMeasure.where((option) {
final searchLower = textEditingValue.text.toLowerCase();
return searchLower.isEmpty ||
option.id.toLowerCase().contains(searchLower) ||
(option.description?.toLowerCase().contains(searchLower) ?? false);
}),
);
}
}
void main() {
runApp(const MainApp());
}
class MainApp extends HookWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
final firstUnitOfMeasure = useState<String?>(null);
final secondUnitOfMeasure = useState<String?>(null);
return MaterialApp(
home: Scaffold(
body: Column(
spacing: 16,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 8,
children: [
Expanded(child: TextFormField()),
Expanded(
child: UnitsOfMeasureAutocomplete(
unitOfMeasureCode: firstUnitOfMeasure.value,
onSelectionChanged: (value) {
firstUnitOfMeasure.value = value?.id;
},
),
),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 8,
children: [
Expanded(
child: TextFormField(
// TODO: Set as true to make the keyboard navigation work
enabled: false,
),
),
Expanded(child: TextFormField(enabled: false)),
],
),
Row(
crossAxisAlignment: CrossAxisAlignment.start,
spacing: 8,
children: [
Expanded(child: TextFormField(enabled: false)),
Expanded(
child: UnitsOfMeasureAutocomplete(
unitOfMeasureCode: secondUnitOfMeasure.value,
onSelectionChanged: (value) {
secondUnitOfMeasure.value = value?.id;
},
),
),
],
),
],
),
),
);
}
}Screenshots or Video
Logs
Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.41.4, on Microsoft Windows [Version 10.0.26200.7840], locale en-CA)
[✓] Windows Version (11 Business 64-bit, 25H2, 2009)
[!] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Chrome - develop for the web
[✓] Visual Studio - develop Windows apps (Visual Studio Professional 2022 17.14.27 (February 2026))
[✓] Connected device (3 available)
[✓] Network resources

Activity
antonio-pedro99 commentedon Mar 10, 2026
Hey @mlizee-epsilia, what about publising the "small code" as a gist? or maybe inlined code support of markdown. Something like
mlizee-epsilia commentedon Mar 11, 2026
Hello @antonio-pedro99 ! I have included the code in the bug description
victorsanni commentedon Mar 12, 2026
cc @justinmc from this PR.
saurabh-mirajkar commentedon Mar 13, 2026
@mlizee-epsilia Thanks for the detailed report and reproduction. I can confirm that I am able to replicate the issue on macOS 26.3.1. Since this affects keyboard navigation within the framework widgets layer, I am labeling this for the framework team to investigate further.
Piinks commentedon Mar 17, 2026
Re-routing the text input team.
Exclude the RawAutocomplete options overlay from the ambient focus tr…
github-actions commentedon May 20, 2026
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 -vand a minimal reproduction of the issue.