-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team
Description
Steps to reproduce
Create a dropdown menu with some entry labels that contains other entry labels, with searchCallback provided.
Similar to #147253, but only when a searchCallback is provided.
Because the fix (#147294) was on the default search function.
Expected results
Arrow key can navigate
Actual results
Down arrow key cannot navigate to second item
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(
home: Scaffold(
body: DropdownMenu<int>(
searchCallback: (List<DropdownMenuEntry<int>> entries, String query) {
if (query.isEmpty) {
return null;
}
final int index = entries.indexWhere(
(DropdownMenuEntry<int> entry) => entry.label.contains(query),
);
return index != -1 ? index : null;
},
dropdownMenuEntries: const <DropdownMenuEntry<int>>[
DropdownMenuEntry<int>(value: 0, label: 'ABC'),
DropdownMenuEntry<int>(value: 1, label: 'AB'),
DropdownMenuEntry<int>(value: 2, label: 'ABCD'),
],
),
),
);
}
}
Screenshots or Video
No response
Logs
No response
Flutter Doctor output
Doctor output
[✓] Flutter (Channel master, 3.24.0-1.0.pre.293, on macOS 14.5 23F79 darwin-arm64, locale en-AU)
• Flutter version 3.24.0-1.0.pre.293 on channel master
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision ccd51a7f58 (2 hours ago), 2024-07-26 21:18:26 +0800
• Engine revision 8714b54a87
• Dart version 3.6.0 (build 3.6.0-83.0.dev)
• DevTools version 2.37.1Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.team-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages team