Repository navigation
OptionsViewOpenDirection.up in (Raw)AutoComplete makes the autocomplete list disappear. #153274
Copy link
Copy link
Closed
Labels
⏳Bot is counting down the days until it unassigns the issueBot is counting down the days until it unassigns the issueP2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 3.24Found to occur in 3.24Found to occur in 3.24frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-text-inputOwned by Text Input teamOwned by Text Input teamtriaged-text-inputTriaged by Text Input teamTriaged by Text Input team
Description
Steps to reproduce
The issue was already addressed (and purportedly resolved) in #138773, but is still reproducible in the exact same way with the latest stable flutter version, even in the online editor. I will add the same reproduction because the issue still persists.
- Go to https://api.flutter.dev/flutter/material/Autocomplete-class.html
- In any of the code samples, add optionsViewOpenDirection: OptionsViewOpenDirection.up, to the Autocomplete widget and click Run.
- Type 'a' in the text field
- No options show up
- Change OptionsViewOpenDirection.up to OptionsViewOpenDirection.down, click Run again and type 'a' in the text field. It works.
Expected results
The list with options appears above the textfield
Actual results
Nothing appears
Code sample
Code sample
import 'package:flutter/material.dart';
/// Flutter code sample for [RawAutocomplete].
void main() => runApp(const AutocompleteExampleApp());
class AutocompleteExampleApp extends StatelessWidget {
const AutocompleteExampleApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('RawAutocomplete Basic'),
),
body: const Center(
child: AutocompleteBasicExample(),
),
),
);
}
}
class AutocompleteBasicExample extends StatelessWidget {
const AutocompleteBasicExample({super.key});
static const List<String> _options = <String>[
'aardvark',
'bobcat',
'chameleon',
];
@override
Widget build(BuildContext context) {
return RawAutocomplete<String>(
optionsBuilder: (TextEditingValue textEditingValue) {
return _options.where((String option) {
return option.contains(textEditingValue.text.toLowerCase());
});
},
fieldViewBuilder: (
BuildContext context,
TextEditingController textEditingController,
FocusNode focusNode,
VoidCallback onFieldSubmitted,
) {
return TextFormField(
controller: textEditingController,
focusNode: focusNode,
onFieldSubmitted: (String value) {
onFieldSubmitted();
},
);
},
optionsViewOpenDirection: OptionsViewOpenDirection.up,
optionsViewBuilder: (
BuildContext context,
AutocompleteOnSelected<String> onSelected,
Iterable<String> options,
) {
return Align(
alignment: Alignment.topLeft,
child: Material(
elevation: 4.0,
child: SizedBox(
height: 200.0,
child: ListView.builder(
padding: const EdgeInsets.all(8.0),
itemCount: options.length,
itemBuilder: (BuildContext context, int index) {
final String option = options.elementAt(index);
return GestureDetector(
onTap: () {
onSelected(option);
},
child: ListTile(
title: Text(option),
),
);
},
),
),
),
);
},
);
}
}Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
[Paste your logs here]Flutter Doctor output
Doctor output
[✓] Flutter (Channel stable, 3.24.0, on macOS 14.4.1 23E224 darwin-arm64, locale en-BE)
• Flutter version 3.24.0 on channel stable at /Users/ghijs/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 80c2e84975 (13 days ago), 2024-07-30 23:06:49 +0700
• Engine revision b8800d88be
• Dart version 3.5.0
• DevTools version 2.37.2
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
• Android SDK at /Users/ghijs/Library/Android/sdk
• Platform android-35, build-tools 35.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
• Xcode at /Applications/Xcode 15.app/Contents/Developer
• Build 15A240d
• CocoaPods version 1.15.2
[✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Android Studio (version 2024.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.11+0-17.0.11b1207.24-11852314)
[✓] VS Code (version 1.91.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.94.0
[✓] Connected device (3 available)
• iPhone 15 (mobile) • 5E510911-C117-479B-93E4-3F8281DA7A19 • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-4
(simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.4.1 23E224 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 14.4.1 23E224 darwin-arm64
! Device emulator-5562 is offline.
[✓] Network resources
• All expected network resources are available.
! Doctor found issues in 1 category.Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
⏳Bot is counting down the days until it unassigns the issueBot is counting down the days until it unassigns the issueP2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 3.24Found to occur in 3.24Found to occur in 3.24frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-text-inputOwned by Text Input teamOwned by Text Input teamtriaged-text-inputTriaged by Text Input teamTriaged by Text Input team
Activity
danagbemava-nc commentedon Aug 12, 2024
Reproducible using the sample provided above.
This is not a recent regression, it seems like the fix didn't take. I tested on stable 3.22.0,3 as well as the latest stable and master and the issue reproduced on all versions. (3.22.0 is the first stable version the fix for this appears in)
flutter doctor -v
Piinks commentedon Aug 14, 2024
We think this falls under text input, but totally fine to kick it back if not. Thanks!
justinmc commentedon Aug 15, 2024
This was mentioned in #143249 (comment) and should be fixed in #143249, but that PR is a bit backed up at the moment. Thank you for opening an issue for this and hopefully I can get that moving soon.
flutter-triage-bot commentedon Dec 20, 2024
This issue is assigned to @justinmc but has had no recent status updates. Please consider unassigning this issue if it is not going to be addressed in the near future. This allows people to have a clearer picture of what work is actually planned. Thanks!
Autocomplete Options Width (#143249)
Autocomplete Options Width (flutter#143249)
github-actions commentedon Jan 28, 2025
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.Autocomplete Options Width (#143249)