Skip to content

Flutter 3.7 breaks TextField widgets that wrap MaterialApp.router #119849

Open
@percula

Description

@percula

Steps to Reproduce

After updating to Flutter 3.7, when a TextField gains focus, the keyboard appears but then immediately is dismissed. This issue was originally reported here. I have confirmed that this issue does not occur in Flutter v3.3. This bug only occurs when a Router is used and only seems to occur for TextFields that are outside the MaterialApp in the widget tree. It is not specific to the wiredash package. I've tested it with flappy and the same thing happens.

  1. Download the Wiredash sample repo
  2. Run the sample on an iOS or Android device. There is no need to provide the Wiredash projectId or secret.
  3. Tap the FAB to bring up the Wiredash interface
  4. Try to type in the TextField

Expected results:
The keyboard will appear and remain.

Actual results:
The keyboard appears and immediately dismisses.

216086169-621711f4-49f7-4e1e-a127-5a971b4c53a6

Code sample

See the sample project.

Logs
[+9897 ms] D/InputMethodManager(18732): showSoftInput() view=io.flutter.embedding.android.FlutterView{71fcbaf VFED..... .F....ID 0,0-1080,2337 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
[  +35 ms] W/OnBackInvokedCallback(18732): OnBackInvokedCallback is not enabled for the application.
[        ] W/OnBackInvokedCallback(18732): Set 'android:enableOnBackInvokedCallback="true"' in the application manifest.
[  +17 ms] D/InsetsController(18732): show(ime(), fromIme=true)
+9897 ms] D/InputMethodManager(18732): showSoftInput() view=io.flutter.embedding.android.FlutterView{71fcbaf VFED..... .F....ID 0,0-1080,2337 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
[  +35 ms] W/OnBackInvokedCallback(18732): OnBackInvokedCallback is not enabled for the application.
[        ] W/OnBackInvokedCallback(18732): Set 'android:enableOnBackInvokedCallback="true"' in the application manifest.
[  +17 ms] D/InsetsController(18732): show(ime(), fromIme=true)
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.
The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.
[!] Flutter (Channel stable, 3.7.1, on macOS 12.6 21G115 darwin-arm64, locale en-US)
    • Flutter version 3.7.1 on channel stable at /Users/peter/development/flutter
    ! Warning: `dart` on your path resolves to /opt/homebrew/Cellar/dart/2.16.1/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/peter/development/flutter. Consider adding
      /Users/peter/development/flutter/bin to the front of your path.
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7048ed95a5 (26 hours ago), 2023-02-01 09:07:31 -0800
    • Engine revision 800594f1f4
    • Dart version 2.19.1
    • DevTools version 2.20.1
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

The operation couldn’t be completed. Unable to locate a Java Runtime.
Please visit http://www.java.com for information on installing Java.
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc1)
    • Android SDK at /Users/peter/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0-rc1
    • Java binary at: /opt/homebrew/opt/openjdk@17/bin/java
    • Java version OpenJDK Runtime Environment Homebrew (build 17.0.6+0)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[!] Android Studio (version 2022.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
    ✗ Unable to find bundled Java version.
    • Try updating or re-installing Android Studio.

[✓] Connected device (3 available)
    • Pixel 7 (mobile) • adb-28281FBH2003ZL-0vnWNw._adb-tls-connect._tcp. • android-arm64  • Android 13 (API 33)
    • macOS (desktop)  • macos                                            • darwin-arm64   • macOS 12.6 21G115 darwin-arm64
    • Chrome (web)     • chrome                                           • web-javascript • Google Chrome 109.0.5414.119

[✓] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 2 categories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: text inputEntering text in a text field or keyboard related problemsc: regressionIt was better in the past than it is nowf: material designflutter/packages/flutter/material repository.f: routesNavigator, Router, and related APIs.found in release: 3.7Found to occur in 3.7found in release: 3.8Found to occur in 3.8frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onteam-designOwned by Design Languages team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions