-
Notifications
You must be signed in to change notification settings - Fork 29.1k
Description
Internal: b/258262191
We have a Flutter application which uses Text inputs.
The text inputs work fine on Desktop WEB with Chrome, Safari, Firefox, Edge, Opera, etc.
The application works well also on mobile native iOS and Android. As you click on the input field, the keyboard appear and you can capture data. This is also true on Android WEB through Chrome.
On iOS WEB using Safari and Chrome though, when you click on the text input, the keyboard doesn't show and makes it impossible to capture data into it.
Here is a video exposing the issue. The video shows the execution of the same app twice. The first app to execute is the Native version. The second is the WEB app through Safari.
keyboard-issue_uaAYhtj3.mp4
We are using a form in our code to facilitate the validation. This issue also happens on every other type of Text input we use.
Widget build(BuildContext context) {
return Title(
[...]
child: SingleChildScrollView(
child: ConstrainedBox(
constraints: [setting maxWidth...]
child: IntrinsicHeight(
child: _body,
),
),
),
);
}
Widget get _body {
return Form(
key: _formKey,
child: Column(
[...]
children: [
[...]
TextFormField(
autofillHints: [...],
decoration: [...],
focusNode: [...],
keyboardType: TextInputType.number,
onChanged: [...],
onFieldSubmitted: [...],
textInputAction: TextInputAction.done,
validator: [...],
),
],
),
);
}
interesting facts:
The keyboard is displayed if you leave and come back to the app
- is on Safari and click on a text input (the keyboard doesn't display)
- and the user switches to another app
- and the user switches back to Safari as the focus is on an input
- Then! the keyboard appears and let you capture your information
Can it be related to Semantic being enabled???
I haven't been able to reproduce this through my gist on dartpad.io
Can it be caused by the fact that we useRendererBinding.instance.setSemanticsEnabled(true);
in our main??? (see commented code in line 7 to 10 of the gist)
We are building an accessible app so we need this Semantic
tree enabled.
Unfortunately, Darpad.IO doesn't seem to like that call to setSemanticsEnabled(true)
as it doesn't load for me when I uncomment those lines.
This is not the number keypad which is displayed
When we execute the app from Android or iOS (both) and succeeds to show the keyboard, it displays the full keyboard, and not the numeric keypad.
iOS | Android |
---|---|
![]() |
![]() |
$ flutter analyze
Analyzing my-app...
No issues found! (ran in 6.2s)
$ flutter doctor -v
[✓] Flutter (Channel stable, 3.0.5, on macOS 12.5.1 21G83 darwin-x64, locale en-US)
• Flutter version 3.0.5 at /usr/local/Caskroom/flutter/3.0.2/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision f1875d570e (6 weeks ago), 2022-07-13 11:24:16 -0700
• Engine revision e85ea0e79c
• Dart version 2.17.6
• DevTools version 2.12.2
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at /Users/israelpainchaud/Library/Android/sdk
• Platform android-33, build-tools 33.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.2)
• 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 11.0.12+0-b1504.28-7817840)
[✓] IntelliJ IDEA Community Edition (version 2022.2.1)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin version 222.3739.24
[✓] Connected device (5 available)
• BS 02 (mobile) • 3d1896e7 • android-arm64 • Android 8.1.0 (API 27)
• sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 13 (API 33) (emulator)
• iPhone SE (3rd generation) (mobile) • 7B3F43F4-5669-4D38-8C80-B9FB8A077928 • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-5 (simulator)
• macOS (desktop) • macos • darwin-x64 • macOS 12.5.1 21G83 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 104.0.5112.101
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!