-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P0Critical issues such as a build break or regressionCritical issues such as a build break or regressioncustomer: soldierf: focusFocus traversal, gaining or losing focusFocus traversal, gaining or losing focusf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.platform-androidAndroid applications specificallyAndroid applications specifically
Description
Steps to Reproduce
Scenario:
Android device navigating with an hardware keyboard, a Scaffold is pushed with Navigator.of(context).pushReplacement after the user confirms with the Enter key in a TextField (in onSubmitted).
The new Scaffold doesn't have the back button in the AppBar but a couples of buttons in the body.
Expected results:
The keyboard focuses on the first button after the push.
Actual results:
The focus of the keyboard is broken and the app can't be navigated with the keyboard.
Example
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class KeyboardTextFieldPushReplacement extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
body: Center(
child: TextField(
onSubmitted: (text) => _pushNewScaffold(context),
),
),
);
}
_pushNewScaffold(BuildContext context) {
Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (context) => PushedScaffold(),
),
);
}
}
class PushedScaffold extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
automaticallyImplyLeading: false,
),
body: Column(
children: [
FlatButton(
child: Text('Button1'),
onPressed: () {},
),
FlatButton(
child: Text('Button2'),
onPressed: () {},
),
],
),
);
}
}$ flutter doctor -v output
[✓] Flutter (Channel master, 1.23.0-19.0.pre.95, on Mac OS X 10.15.7 19H2
darwin-x64, locale it-IT)
• Flutter version 1.23.0-19.0.pre.95 at
/Users/lorenzooliveto/Flutter/flutter
• Framework revision a837557634 (23 hours ago), 2020-10-18 06:12:02 -0400
• Engine revision 499a70f5e2
• Dart version 2.11.0 (build 2.11.0-234.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/lorenzooliveto/Library/Android/sdk
• Platform android-29, build-tools 29.0.3
• ANDROID_HOME = /Users/lorenzooliveto/Library/Android/sdk
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.0.1, Build version 12A7300
• CocoaPods version 1.10.0.rc.1
[✓] Android Studio (version 4.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
1.8.0_242-release-1644-b3-6222593)
[✓] Connected device (1 available)
• iPhone di Lorenzo (mobile) • 63e1defd8bca92bd059530106598ec853b3609ac •
ios • iOS 14.0.1
! Error: iPhone di Lorenzo is busy: Copying cache files from device. Xcode
will continue when iPhone di Lorenzo is finished. (code -10)
• No issues found!
Metadata
Metadata
Assignees
Labels
P0Critical issues such as a build break or regressionCritical issues such as a build break or regressioncustomer: soldierf: focusFocus traversal, gaining or losing focusFocus traversal, gaining or losing focusf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.platform-androidAndroid applications specificallyAndroid applications specifically