flutter
flutter copied to clipboard
[web] Textfield 'autofocus: true' doesn't show up the keyboard
It only gets in the focused mode which I know by changing the TextField focusedBorder
property that it's being listened to but no keyboard there.
doctor
[✓] Flutter (Channel dev, 1.19.0-2.0.pre, on Mac OS X 10.15.5 19F101, locale es-ES)
• Flutter version 1.19.0-2.0.pre at /Users/tomas/Development/flutter
• Framework revision 1d395c5e18 (2 days ago), 2020-05-31 07:41:50 -0700
• Engine revision 923687f0e7
• Dart version 2.9.0 (build 2.9.0-11.0.dev 6489a0c68d)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/tomas/Library/Android/sdk
• Platform android-29, build-tools 29.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.5)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.5, Build version 11E608c
• CocoaPods version 1.9.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 3.6)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 44.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[✓] VS Code (version 1.45.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.11.0
[✓] Connected device (3 available)
• iPhone 11 • 04298E38-2633-4586-B868-1FBD5C708AF7 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-5 (simulator)
• Web Server • web-server • web-javascript • Flutter Tools
• Chrome • chrome • web-javascript • Google Chrome 83.0.4103.61
• No issues found!
Hi @tomasbaran Can you please provide a minimal complete reproducible code sample. Thank you
Sure, it's just adding Textfield:
TextField(autofocus: true),
If you want to see the focusedBorder difference:
TextField(
autofocus: true,
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.pink),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.green),
),
),
),
Full Sample Code (default counter app)
import 'package:flutter/material.dart';void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
// This is the theme of your application.
//
// Try running your application with "flutter run". You'll see the
// application has a blue toolbar. Then, without quitting the app, try
// changing the primarySwatch below to Colors.green and then invoke
// "hot reload" (press "r" in the console where you ran "flutter run",
// or simply save your changes to "hot reload" in a Flutter IDE).
// Notice that the counter didn't reset back to zero; the application
// is not restarted.
primarySwatch: Colors.blue,
// This makes the visual density adapt to the platform that you run
// the app on. For desktop platforms, the controls will be smaller and
// closer together (more dense) than on mobile platforms.
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
// This widget is the home page of your application. It is stateful, meaning
// that it has a State object (defined below) that contains fields that affect
// how it looks.
// This class is the configuration for the state. It holds the values (in this
// case the title) provided by the parent (in this case the App widget) and
// used by the build method of the State. Fields in a Widget subclass are
// always marked "final".
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
// This call to setState tells the Flutter framework that something has
// changed in this State, which causes it to rerun the build method below
// so that the display can reflect the updated values. If we changed
// _counter without calling setState(), then the build method would not be
// called again, and so nothing would appear to happen.
_counter++;
});
}
@override
Widget build(BuildContext context) {
// This method is rerun every time setState is called, for instance as done
// by the _incrementCounter method above.
//
// The Flutter framework has been optimized to make rerunning build methods
// fast, so that you can just rebuild anything that needs updating rather
// than having to individually change instances of widgets.
return Scaffold(
appBar: AppBar(
// Here we take the value from the MyHomePage object that was created by
// the App.build method, and use it to set our appbar title.
title: Text(widget.title),
),
body: Center(
// Center is a layout widget. It takes a single child and positions it
// in the middle of the parent.
child: Column(
// Column is also a layout widget. It takes a list of children and
// arranges them vertically. By default, it sizes itself to fit its
// children horizontally, and tries to be as tall as its parent.
//
// Invoke "debug painting" (press "p" in the console, choose the
// "Toggle Debug Paint" action from the Flutter Inspector in Android
// Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
// to see the wireframe for each widget.
//
// Column has various properties to control how it sizes itself and
// how it positions its children. Here we use mainAxisAlignment to
// center the children vertically; the main axis here is the vertical
// axis because Columns are vertical (the cross axis would be
// horizontal).
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
TextField(
autofocus: true,
decoration: InputDecoration(
focusedBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.pink),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(color: Colors.green),
),
),
),
Text(
'You have pushed the button this many times:',
),
Text(
'$_counter',
style: Theme.of(context).textTheme.headline4,
),
],
),
),
floatingActionButton: FloatingActionButton(
onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add),
), // This trailing comma makes auto-formatting nicer for build methods.
);
}
}
Try the sample code in chrome flutter run -d chrome
on iPhone SE - simulator (iOS 12) in Safari to see the issue. The issue is not present on iPhone XR - simulator BUT IT IS present on the real iPhone XR (iOS 13.5).
Hi @tomasbaran I tested your code with the latest master and I encounter the behaviour you are describing
logs
[ +21 ms] executing: [/Users/nevercode/development/flutter_master/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +195 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[ +67 ms] 2ece1c3a174c3dd7099736f13b4ad16bb9b70c1d
[ +2 ms] executing: [/Users/nevercode/development/flutter_master/] git tag --contains HEAD
[+1085 ms] Exit code 0 from: git tag --contains HEAD
[ +5 ms] executing: [/Users/nevercode/development/flutter_master/] git describe --match *.*.*-*.*.pre --first-parent --long --tags
[ +74 ms] Exit code 0 from: git describe --match *.*.*-*.*.pre --first-parent --long --tags
[ +2 ms] 1.19.0-3.0.pre-20-g2ece1c3a1
[ +25 ms] executing: [/Users/nevercode/development/flutter_master/] git rev-parse --abbrev-ref --symbolic @{u}
[ +28 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ ] origin/master
[ ] executing: [/Users/nevercode/development/flutter_master/] git ls-remote --get-url origin
[ +26 ms] Exit code 0 from: git ls-remote --get-url origin
[ +1 ms] https://github.com/flutter/flutter.git
[ +174 ms] executing: [/Users/nevercode/development/flutter_master/] git rev-parse --abbrev-ref HEAD
[ +23 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ ] master
[ +21 ms] executing: sw_vers -productName
[ +52 ms] Exit code 0 from: sw_vers -productName
[ ] Mac OS X
[ ] executing: sw_vers -productVersion
[ +36 ms] Exit code 0 from: sw_vers -productVersion
[ +4 ms] 10.15.4
[ +2 ms] executing: sw_vers -buildVersion
[ +36 ms] Exit code 0 from: sw_vers -buildVersion
[ +1 ms] 19E287
[ +133 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[ +36 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +52 ms] executing: /Users/nevercode/Library/Android/sdk/platform-tools/adb devices -l
[ +33 ms] executing: /usr/bin/xcode-select --print-path
[ +26 ms] Exit code 0 from: /usr/bin/xcode-select --print-path
[ ] /Applications/Xcode.app/Contents/Developer
[ +6 ms] executing: /usr/bin/xcodebuild -version
[+1397 ms] Exit code 0 from: /usr/bin/xcodebuild -version
[ ] Xcode 11.3.1
Build version 11C504
[ +9 ms] executing: xcrun --find xcdevice
[ +23 ms] Exit code 0 from: xcrun --find xcdevice
[ ] /Applications/Xcode.app/Contents/Developer/usr/bin/xcdevice
[ ] executing: xcrun xcdevice list --timeout 2
[ +10 ms] /usr/bin/xcrun simctl list --json devices
[ ] executing: /usr/bin/xcrun simctl list --json devices
[ +71 ms] List of devices attached
965AY0WP5C device usb:337641472X product:sargo model:Pixel_3a device:sargo transport_id:1
[ +118 ms] {
"devices" : {
"com.apple.CoreSimulator.SimRuntime.watchOS-6-1" : [
{
"state" : "Shutdown",
"isAvailable" : true,
"name" : "Apple Watch Series 4 - 40mm",
"udid" : "7F389A7F-C267-412A-8DB8-63A83386A06F"
},
{
"state" : "Shutdown",
"isAvailable" : true,
"name" : "Apple Watch Series 4 - 44mm",
"udid" : "3568E5A3-98A0-414B-9A79-5CC234FA6E2B"
},
{
"state" : "Shutdown",
"isAvailable" : true,
"name" : "Apple Watch Series 5 - 40mm",
"udid" : "3B543693-444A-4E3D-BD8A-9BD2AE2EDD2F"
},
{
"state" : "Shutdown",
"isAvailable" : true,
"name" : "Apple Watch Series 5 - 44mm",
"udid" : "AF6A4F31-535E-4FE6-A062-49A81AB5AAE3"
}
],
"com.apple.CoreSimulator.SimRuntime.tvOS-13-3" : [
{
"state" : "Shutdown",
"isAvailable" : true,
"name" : "Apple TV",
"udid" : "8EC4E84F-BA3E-4251-8351-8324AC08E126"
},
{
"state" : "Shutdown",
"isAvailable" : true,
"name" : "Apple TV 4K",
"udid" : "8FFD5279-9EEA-49AE-83CA-8736CB3E61AB"
},
{
"state" : "Shutdown",
"isAvailable" : true,
"name" : "Apple TV 4K (at 1080p)",
"udid" : "8A1D2EC5-B2B9-474D-81DF-E6A3D0DB84EF"
}
],
"com.apple.CoreSimulator.SimRuntime.iOS-13-3" : [
{
"state" : "Shutdown",
"isAvailable" : true,
"name" : "iPhone 8",
"udid" : "D5F70F31-B488-4454-9539-320B5551D92A"
},
{
"state" : "Shutdown",
"isAvailable" : true,
"name" : "iPhone 8 Plus",
"udid" : "62B827A3-68BD-46BD-8E92-DE5297DF3840"
},
{
"state" : "Shutdown",
"isAvailable" : true,
"name" : "iPhone 11",
"udid" : "D1B95CB0-D10B-4983-9AFE-6DB7C4006D15"
},
{
"state" : "Shutdown",
"isAvailable" : true,
"name" : "iPhone 11 Pro",
"udid" : "8B67BA47-2EED-4956-B383-17112E09F7BC"
},
{
"state" : "Booted",
"isAvailable" : true,
"name" : "iPhone 11 Pro Max",
"udid" : "A1664A8D-8DB6-4659-B012-18746A2DB8C3"
},
{
"state" : "Shutdown",
"isAvailable" : true,
"name" : "iPad Pro (9.7-inch)",
"udid" : "A7BC437A-C1AB-4DDC-B723-5BC2411FF606"
},
{
"state" : "Shutdown",
"isAvailable" : true,
"name" : "iPad (7th generation)",
"udid" : "50905834-EA49-46D1-9282-2BFD80B002C9"
},
{
"state" : "Shutdown",
"isAvailable" : true,
"name" : "iPad Pro (11-inch)",
"udid" : "C37B8020-20B5-44D3-BB6B-1E34569A3E57"
},
{
"state" : "Shutdown",
"isAvailable" : true,
"name" : "iPad Pro (12.9-inch) (3rd generation)",
"udid" : "BBD1E939-BE74-444C-825D-6DA528EF37D0"
},
{
"state" : "Shutdown",
"isAvailable" : true,
"name" : "iPad Air (3rd generation)",
"udid" : "609AAB06-1510-466F-82F8-1951E7EAFCD2"
}
]
}
}
[+4859 ms] [
{
"simulator" : true,
"operatingSystemVersion" : "13.3 (17K446)",
"available" : true,
"platform" : "com.apple.platform.appletvsimulator",
"modelCode" : "AppleTV6,2",
"identifier" : "8FFD5279-9EEA-49AE-83CA-8736CB3E61AB",
"architecture" : "x86_64",
"modelName" : "Apple TV 4K",
"name" : "Apple TV 4K"
},
{
"simulator" : true,
"operatingSystemVersion" : "13.3 (17C45)",
"available" : true,
"platform" : "com.apple.platform.iphonesimulator",
"modelCode" : "iPad8,1",
"identifier" : "C37B8020-20B5-44D3-BB6B-1E34569A3E57",
"architecture" : "x86_64",
"modelName" : "iPad Pro (11-inch)",
"name" : "iPad Pro (11-inch)"
},
{
"simulator" : true,
"operatingSystemVersion" : "13.3 (17K446)",
"available" : true,
"platform" : "com.apple.platform.appletvsimulator",
"modelCode" : "AppleTV6,2",
"identifier" : "8A1D2EC5-B2B9-474D-81DF-E6A3D0DB84EF",
"architecture" : "x86_64",
"modelName" : "Apple TV 4K (at 1080p)",
"name" : "Apple TV 4K (at 1080p)"
},
{
"simulator" : true,
"operatingSystemVersion" : "13.3 (17C45)",
"available" : true,
"platform" : "com.apple.platform.iphonesimulator",
"modelCode" : "iPhone12,5",
"identifier" : "A1664A8D-8DB6-4659-B012-18746A2DB8C3",
"architecture" : "x86_64",
"modelName" : "iPhone 11 Pro Max",
"name" : "iPhone 11 Pro Max"
},
{
"simulator" : true,
"operatingSystemVersion" : "13.3 (17C45)",
"available" : true,
"platform" : "com.apple.platform.iphonesimulator",
"modelCode" : "iPad6,4",
"identifier" : "A7BC437A-C1AB-4DDC-B723-5BC2411FF606",
"architecture" : "x86_64",
"modelName" : "iPad Pro (9.7-inch)",
"name" : "iPad Pro (9.7-inch)"
},
{
"simulator" : true,
"operatingSystemVersion" : "6.1.1 (17S445)",
"available" : true,
"platform" : "com.apple.platform.watchsimulator",
"modelCode" : "Watch4,4",
"identifier" : "3568E5A3-98A0-414B-9A79-5CC234FA6E2B",
"architecture" : "i386",
"modelName" : "Apple Watch Series 4 - 44mm",
"name" : "Apple Watch Series 4 - 44mm"
},
{
"simulator" : true,
"operatingSystemVersion" : "13.3 (17C45)",
"available" : true,
"platform" : "com.apple.platform.iphonesimulator",
"modelCode" : "iPad11,3",
"identifier" : "609AAB06-1510-466F-82F8-1951E7EAFCD2",
"architecture" : "x86_64",
"modelName" : "iPad Air (3rd generation)",
"name" : "iPad Air (3rd generation)"
},
{
"simulator" : true,
"operatingSystemVersion" : "13.3 (17K446)",
"available" : true,
"platform" : "com.apple.platform.appletvsimulator",
"modelCode" : "AppleTV5,3",
"identifier" : "8EC4E84F-BA3E-4251-8351-8324AC08E126",
"architecture" : "x86_64",
"modelName" : "Apple TV",
"name" : "Apple TV"
},
{
"simulator" : true,
"operatingSystemVersion" : "13.3 (17C45)",
"available" : true,
"platform" : "com.apple.platform.iphonesimulator",
"modelCode" : "iPhone10,4",
"identifier" : "D5F70F31-B488-4454-9539-320B5551D92A",
"architecture" : "x86_64",
"modelName" : "iPhone 8",
"name" : "iPhone 8"
},
{
"simulator" : true,
"operatingSystemVersion" : "13.3 (17C45)",
"available" : true,
"platform" : "com.apple.platform.iphonesimulator",
"modelCode" : "iPad8,5",
"identifier" : "BBD1E939-BE74-444C-825D-6DA528EF37D0",
"architecture" : "x86_64",
"modelName" : "iPad Pro (12.9-inch) (3rd generation)",
"name" : "iPad Pro (12.9-inch) (3rd generation)"
},
{
"simulator" : true,
"operatingSystemVersion" : "13.3 (17C45)",
"available" : true,
"platform" : "com.apple.platform.iphonesimulator",
"modelCode" : "iPhone12,3",
"identifier" : "8B67BA47-2EED-4956-B383-17112E09F7BC",
"architecture" : "x86_64",
"modelName" : "iPhone 11 Pro",
"name" : "iPhone 11 Pro"
},
{
"simulator" : true,
"operatingSystemVersion" : "6.1.1 (17S445)",
"available" : true,
"platform" : "com.apple.platform.watchsimulator",
"modelCode" : "Watch5,3",
"identifier" : "3B543693-444A-4E3D-BD8A-9BD2AE2EDD2F",
"architecture" : "i386",
"modelName" : "Apple Watch Series 5 - 40mm",
"name" : "Apple Watch Series 5 - 40mm"
},
{
"simulator" : true,
"operatingSystemVersion" : "13.3 (17C45)",
"available" : true,
"platform" : "com.apple.platform.iphonesimulator",
"modelCode" : "iPhone10,5",
"identifier" : "62B827A3-68BD-46BD-8E92-DE5297DF3840",
"architecture" : "x86_64",
"modelName" : "iPhone 8 Plus",
"name" : "iPhone 8 Plus"
},
{
"simulator" : true,
"operatingSystemVersion" : "13.3 (17C45)",
"available" : true,
"platform" : "com.apple.platform.iphonesimulator",
"modelCode" : "iPhone12,1",
"identifier" : "D1B95CB0-D10B-4983-9AFE-6DB7C4006D15",
"architecture" : "x86_64",
"modelName" : "iPhone 11",
"name" : "iPhone 11"
},
{
"simulator" : true,
"operatingSystemVersion" : "13.3 (17C45)",
"available" : true,
"platform" : "com.apple.platform.iphonesimulator",
"modelCode" : "iPad7,12",
"identifier" : "50905834-EA49-46D1-9282-2BFD80B002C9",
"architecture" : "x86_64",
"modelName" : "iPad (7th generation)",
"name" : "iPad (7th generation)"
},
{
"simulator" : true,
"operatingSystemVersion" : "6.1.1 (17S445)",
"available" : true,
"platform" : "com.apple.platform.watchsimulator",
"modelCode" : "Watch4,3",
"identifier" : "7F389A7F-C267-412A-8DB8-63A83386A06F",
"architecture" : "i386",
"modelName" : "Apple Watch Series 4 - 40mm",
"name" : "Apple Watch Series 4 - 40mm"
},
{
"simulator" : true,
"operatingSystemVersion" : "6.1.1 (17S445)",
"available" : true,
"platform" : "com.apple.platform.watchsimulator",
"modelCode" : "Watch5,4",
"identifier" : "AF6A4F31-535E-4FE6-A062-49A81AB5AAE3",
"architecture" : "i386",
"modelName" : "Apple Watch Series 5 - 44mm",
"name" : "Apple Watch Series 5 - 44mm"
}
]
[ +23 ms] Artifact Instance of 'AndroidMavenArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[ +4 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[ ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[ +669 ms] Generating /Users/nevercode/Desktop/projects/master/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
[ +705 ms] Launching lib/main.dart on Chrome in debug mode...
[ +900 ms] Updating assets
[ +407 ms] Syncing files to device Chrome...
[ +231 ms] Generating /Users/nevercode/Desktop/projects/master/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
[ +97 ms] <- reset
[ +80 ms] /Users/nevercode/development/flutter_master/bin/cache/dart-sdk/bin/dart
/Users/nevercode/development/flutter_master/bin/cache/artifacts/engine/darwin-x64/frontend_server.dart.snapshot --sdk-root
/Users/nevercode/development/flutter_master/bin/cache/flutter_web_sdk/ --incremental --target=dartdevc --debugger-module-names -Ddart.developer.causal_async_stacks=true
--output-dill /var/folders/c3/l5jpznsj5k37yrj47l__xpw40000gn/T/flutter_tools.EdIapP/flutter_tool.yWo95U/app.dill --libraries-spec
file:///Users/nevercode/development/flutter_master/bin/cache/flutter_web_sdk/libraries.json --packages .packages -Ddart.vm.profile=false -Ddart.vm.product=false
--bytecode-options=source-positions,local-var-info,debugger-stops,instance-field-initializers,keep-unreachable-code,avoid-closure-call-instructions --enable-asserts
--track-widget-creation --filesystem-root /var/folders/c3/l5jpznsj5k37yrj47l__xpw40000gn/T/flutter_tools.EdIapP/flutter_tools.mAbimx --filesystem-scheme org-dartlang-app
--initialize-from-dill build/cache.dill.track.dill --platform file:///Users/nevercode/development/flutter_master/bin/cache/flutter_web_sdk/kernel/flutter_ddc_sdk.dill
[ +33 ms] <- compile org-dartlang-app:/web_entrypoint.dart
[+28735 ms] Syncing files to device Chrome... (completed in 29,166ms, longer than expected)
[ +1 ms] Synced 22.7MB.
[ +1 ms] <- accept
[+1239 ms] [CHROME]:
[ +13 ms] [CHROME]:DevTools listening on ws://127.0.0.1:61169/devtools/browser/b96fe5f1-97ce-4455-8b12-ce40a44e8c8d
[+5578 ms] Debug service listening on ws://127.0.0.1:61191/P5VCyZTelU4=
[ +682 ms] Debug service listening on ws://127.0.0.1:61191/P5VCyZTelU4=
[ +3 ms] Warning: Flutter's support for web development is not stable yet and hasn't
[ ] been thoroughly tested in production environments.
[ ] For more information see https://flutter.dev/web
[ ] 🔥 To hot restart changes while running, press "r" or "R".
[ +1 ms] For a more detailed help message, press "h". To quit, press "q".
[+41247 ms] Stopped debug service on ws://127.0.0.1:61191
[ +423 ms] Application finished.
[ +4 ms] "flutter run" took 87,799ms.
[ +300 ms] Running shutdown hooks
[ +2 ms] Shutdown hook priority 4
[ +773 ms] Shutdown hooks complete
doctor
[✓] Flutter (Channel master, 1.19.0-4.0.pre.20, on Mac OS X 10.15.4 19E287, locale en-GB)
• Flutter version 1.19.0-4.0.pre.20 at /Users/nevercode/development/flutter_master
• Framework revision 2ece1c3a17 (10 hours ago), 2020-06-02 19:00:12 -0700
• Engine revision 6589dcb2d4
• Dart version 2.9.0 (build 2.9.0-13.0.dev 3d53df52af)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/nevercode/Library/Android/sdk
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.3.1, Build version 11C504
• CocoaPods version 1.9.0
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 3.6)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 45.1.1
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[✓] VS Code
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.11.0
[✓] Connected device (4 available)
• Pixel 3a • 965AY0WP5C • android-arm64 • Android 10 (API 29)
• iPhone 11 Pro Max • A1664A8D-8DB6-4659-B012-18746A2DB8C3 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)
• Web Server • web-server • web-javascript • Flutter Tools
• Chrome • chrome • web-javascript • Google Chrome 83.0.4103.61
• No issues found!
Thank you
Since this issue is also present on iOS12 and on iPhone SE, it may be related to these issues (which are also present only on iOS12 on iPhone SE: https://github.com/flutter/flutter/issues/58510 and https://github.com/flutter/flutter/issues/58518
I have the same issue with autofocus: true :
- Page to test: https://tvrandshow.com
- Device: iPhone 6 with 12.4.7 iOS
- Browser: Safari, Chrome 83.0 and partially in Firefox 26.0
The special situation in Firefox is:
- The first time than load page, the autofocus dont work, but I can open the keyboard. But, when navigate to another page and back to page with autofocus, I can't open the keyboard.
@deandreamatias If you want to issue to be fixed sooner, it's also worth to +1 (thumb up) on the original issue. Just in case, you didn't know.
Anyone found any workaround for this, please?
Anyone found any workaround for this, please?
You try with lastest flutter beta version @tomasbaran ?
@deandreamatias Sure, I tried it on the latest beta as well as on the latest master. Why are you asking? Was it working for you on the latest beta?
Don't work for me, but is nice know to Flutter team
Not even doing it manually helps with focusNode
:
FocusNode _focusNode;
@override
void initState() {
super.initState();
_focusNode = FocusNode();
_focusNode.requestFocus();
}
TextField(
focusNode: _focusNode;
)
Maybe that's what's causing the issue in the first place. Doesn't autofocus: true
just do what my code above does with the focusNode
? I mean, isn't autofocus: true
kind of a shortcut for the code above? If so, we found the root of the problem...
I was able to reproduce this issue on latest master, and dev channels.
Flutter web deployed at https://app.netlify.com/sites/nostalgic-yalow-cbd570/overview.
flutter doctor
[✓] Flutter (Channel master, 1.26.0-2.0.pre.165, on Mac OS X 10.15.7 19H2 darwin-x64, locale en)
• Flutter version 1.26.0-2.0.pre.165 at /Users/pedromassango/dev/SDKs/flutter_master
• Framework revision efc84ab1ec (9 hours ago), 2020-12-31 10:00:55 +0800
• Engine revision 82b4ae86d6
• Dart version 2.12.0 (build 2.12.0-179.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/pedromassango/Library/Android/sdk
• Platform android-30, build-tools 30.0.2
• 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-6915495)
• All Android licenses accepted.
[!] Xcode - develop for iOS and macOS (Xcode 12.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.1, Build version 12A7403
! CocoaPods 1.9.3 out of date (1.10.0 is recommended).
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] 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-6915495)
[✓] IntelliJ IDEA Community Edition (version 2020.3)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 52.1.5
• Dart plugin version 203.5981.152
[✓] VS Code (version 1.51.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.16.0
[✓] Connected device (3 available)
• Redmi 5 Plus (mobile) • 0258ff700005 • android-arm64 • Android 8.1.0 (API 27)
• macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.7 19H2 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 87.0.4280.88
! Doctor found issues in 1 category.
Process finished with exit code 0
Bumping -- occurring on safari and chrome web (mobile).
@iapicca you should remove browser:safari label, the problem happens in chrome also
flutter run -d chrome
How can you debug web on iOS simulator ?
flutter run -d chrome
How can you debug web on iOS simulator ?
your app will run on localhost, you will have the URI, then just simply browse it in the simulator
@iapicca you should remove browser:safari label, the problem happens in chrome also
@Lafannn I don't have this power
Did anyone find a solution for this? I still encounter this issue, only on iOS Safari. On an Android device with Chrome it works perfectly
doctor
[√] Flutter (Channel beta, 2.4.0-4.2.pre, on Microsoft Windows [Versione 10.0.19043.1110], locale it-IT)
• Flutter version 2.4.0-4.2.pre at C:\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision f18b9281c2 (5 days ago), 2021-07-22 14:08:30 -0700
• Engine revision 844c29f42a
• Dart version 2.14.0 (build 2.14.0-301.2.beta)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\Users\Danie\AppData\Local\Android\sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b01)
• All Android licenses accepted.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.9.0)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.9.31025.194
• Windows 10 SDK version 10.0.19041.0
[√] Android Studio (version 4.1.0)
• Android Studio at C:\Program Files\Android\Android Studio
• 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-b01)
[√] VS Code (version 1.53.2)
• VS Code at C:\Users\Danie\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.20.0
[√] Connected device (3 available)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Versione 10.0.19043.1110]
• Chrome (web) • chrome • web-javascript • Google Chrome 92.0.4515.107
• Edge (web) • edge • web-javascript • Microsoft Edge 92.0.902.55
• No issues found!
following!
Any progress on this ? I am also able to reproduce it on all the Flutter channels on Flutter web.
Any workarounds to this?
It still is an issue right now
+1
in my case, I have only one text field on the screen and it has an autofocus
. As a result, it is impossible to use the app on the web from ios
mark +1
Steps to Reproduce
- I used this example form_app from Flutter samples
- To demonstrate bug I visited Sample Flutter form
Steps that I made:
- Enter the page and press the button to "Sign in with HTTP" page.
- My keyboard appears and focuses on input.
- Click on the button that leads to the back page.
- Press again the button leading to the "Sign in with HTTPS" page
Expected results:
My expectation is that every time I enter the page my keyboard and focus will appear on the input.
Actual results:
After a few repetitions of the steps mentioned above, the focus remains on the input but the keyboard no longer appears.
This only happens on Safari on iOS, I also tested it on Chrome ( on iOS ) and Android phones as a result it worked. A strange fact is that the keyboard does not appear even though the focus is visible on the given input. When I refresh the page everything starts to work and then again it doesn't work properly
Code sample: Here
Attached video to demonstrate bug:
Safari, iOS 15.4.1 (19E258)
https://youtube.com/shorts/NKtDUnWV16I?feature=share
Chrome, iOS 15.4.1 (19E258)
https://user-images.githubusercontent.com/16977962/167635617-459a6fa6-e251-4f18-8cf7-91cb7b8d8a7c.mov
@denddyprod Thanks for the report. From the code you shared, I observed that it uses
autofocus: true
which could be reason why keyboard doesn't show up. Here's an original issue for it: #58498Can you try without
autofocus: true
and see if it works as expected then ?
I set autofocus: false
and focused manually on initState:
late FocusNode firstFocus;
@override
void initState() {
firstFocus = FocusNode();
firstFocus.requestFocus();
super.initState();
}
...
TextFormField( focusNode: firstFocus, autofocus: false,
Unfortunately, the result is same as case with autofocus: true
and problem still persists.
I'm also experiencing the same issue. When I remove autofocus and recompile it works with a double tap
Bad workaround:
import 'package:flutter/foundation.dart';
final isWebMobile = kIsWeb && (defaultTargetPlatform == TargetPlatform.iOS || defaultTargetPlatform == TargetPlatform.android);
TextField(
autofocus: ! isWebMobile,
...
)
Still there is no workaround?
Any updates guys? Nothing helped so far