You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Flutter Web (Chrome browser) - TextFormField losing focus after it goes to background, for example on a tab switch #178109
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.35.0, on macOS 26.0.1 25A362 darwin-arm64, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.95.3)
@ulisseshen Flutter doctor summary
On Web we use TextFormField. Our users copy text from a file and try to paste it in our TextFormField, but it loses focus as soon as they switch the tab or minimize our Web App on Chrome browser.
changed the title [-]Flutter Web - TextFormField losing focus after it goes to background, for example on a tab switch[/-][+]Flutter Web (Chrome browser) - TextFormField losing focus after it goes to background, for example on a tab switch[/+]on Nov 6, 2025
Hi @vikasdwivedi-kuhoo, thanks for filing this issue. To make it easier for us to determine what broke this behavior, kindly tell us which version of flutter you were on before you upgraded to 3.35.0
Reproducible using the steps outlined above. Can confirm this is a regression as it worked as expected on stable 3.32.8 but not the latest stable & master.
In my testing, it appeared to work on Safari but not Firefox and Chrome.
import'package:flutter/material.dart';
voidmain() {
runApp(constMyApp());
}
classMyAppextendsStatelessWidget {
constMyApp({super.key});
@overrideWidgetbuild(BuildContext context) {
returnMaterialApp(
title:'TextFormField Focus Issue #178109',
home:Scaffold(
appBar:AppBar(title:constText('TextFormField Focus Test')),
body:Center(
child:SizedBox(
width:300,
child:Column(
mainAxisAlignment:MainAxisAlignment.center,
children: [
constText('1. Click and type in the field below'),
constText('2. Switch to another browser tab'),
constText('3. Switch back to this tab'),
constText('4. Notice: Focus is lost (bug)'),
constSizedBox(height:20),
TextFormField(
decoration:constInputDecoration(
labelText:'Type here',
border:OutlineInputBorder(),
),
),
],
),
),
),
),
);
}
}
flutter doctor -v
[!] Flutter (Channel [user-branch], 3.32.8, on macOS 26.2 25C5031i darwin-arm64, locale en-US) [739ms]
! Flutter version 3.32.8 on channel [user-branch] at /Users/deanli/dev/switcher
Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
! Warning: `flutter` on your path resolves to /Users/deanli/dev/stable/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/deanli/dev/switcher. Consider adding /Users/deanli/dev/switcher/bin to the front of your path.
! Warning: `dart` on your path resolves to /Users/deanli/dev/stable/bin/dart, which is not inside your current Flutter SDK checkout at /Users/deanli/dev/switcher. Consider adding /Users/deanli/dev/switcher/bin to the front of your path.
! Upstream repository unknown source is not a standard remote.
Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
• Framework revision edada7c56e (4 months ago), 2025-07-25 14:08:03 +0000
• Engine revision ef0cd00091
• Dart version 3.8.1
• DevTools version 2.45.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.
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [1,797ms]
• Android SDK at /Users/deanli/Library/Android/sdk
• Platform android-36.1, build-tools 36.1.0
• Java binary at: /Users/deanli/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.8+-14196175-b1038.72)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 26.2) [1,316ms]
• Xcode at /Applications/Xcode-26.2.0-beta.app/Contents/Developer
• Build 17C5013i
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [11ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2025.2) [11ms]
• Android Studio at /Users/deanli/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 21.0.8+-14196175-b1038.72)
[✓] VS Code (version 1.105.1) [10ms]
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.122.0
[✓] Connected device (4 available) [7.4s]
• Dean iPad (wireless) (mobile) • 00008103-000825C811E3401E • ios • iOS 26.1 23B5059e
• iPhone 16 Pro Max (mobile) • 00008140-00194CC23A68801C • ios • iOS 26.1 23B82
• macOS (desktop) • macos • darwin-arm64 • macOS 26.2 25C5031i darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 142.0.7444.135
! Error: Browsing on the local area network for Nexus. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources [762ms]
• All expected network resources are available.
! Doctor found issues in 1 category.
[✓] Flutter (Channel stable, 3.35.7, on macOS 26.2 25C5031i darwin-arm64, locale en-US) [641ms]
• Flutter version 3.35.7 on channel stable at /Users/deanli/dev/stable
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision adc9010625 (3 weeks ago), 2025-10-21 14:16:03 -0400
• Engine revision 035316565a
• Dart version 3.9.2
• DevTools version 2.48.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-lldb-debugging
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [1,712ms]
• Android SDK at /Users/deanli/Library/Android/sdk
• Emulator version 36.2.12.0 (build_id 14214601) (CL:N/A)
• Platform android-36.1, build-tools 36.1.0
• Java binary at: /Users/deanli/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.8+-14196175-b1038.72)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 26.2) [1,357ms]
• Xcode at /Applications/Xcode-26.2.0-beta.app/Contents/Developer
• Build 17C5013i
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [6ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2025.2) [6ms]
• Android Studio at /Users/deanli/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 21.0.8+-14196175-b1038.72)
[✓] VS Code (version 1.105.1) [5ms]
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.122.0
[✓] Connected device (4 available) [7.4s]
• Dean iPad (wireless) (mobile) • 00008103-000825C811E3401E • ios • iOS 26.1 23B5059e
• iPhone 16 Pro Max (mobile) • 00008140-00194CC23A68801C • ios • iOS 26.1 23B82
• macOS (desktop) • macos • darwin-arm64 • macOS 26.2 25C5031i darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 142.0.7444.135
! Error: Browsing on the local area network for Nexus. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources [717ms]
• All expected network resources are available.
• No issues found!
[!] Flutter (Channel master, 3.38.0-1.0.pre-474, on macOS 26.2 25C5031i darwin-arm64, locale en-US) [1,799ms]
• Flutter version 3.38.0-1.0.pre-474 on channel master at /Users/deanli/dev/master
! Warning: `flutter` on your path resolves to /Users/deanli/dev/stable/bin/flutter, which is not inside your current Flutter SDK checkout at /Users/deanli/dev/master. Consider adding /Users/deanli/dev/master/bin to the front of your path.
! Warning: `dart` on your path resolves to /Users/deanli/dev/stable/bin/dart, which is not inside your current Flutter SDK checkout at /Users/deanli/dev/master. Consider adding /Users/deanli/dev/master/bin to the front of your path.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision e74c595450 (2 days ago), 2025-11-08 01:03:30 -0500
• Engine revision e74c595450
• Dart version 3.11.0 (build 3.11.0-113.0.dev)
• DevTools version 2.52.0
• Feature flags: enable-web, enable-linux-desktop, enable-macos-desktop, enable-windows-desktop, enable-android, enable-ios, cli-animations, enable-native-assets, omit-legacy-version-file, enable-lldb-debugging
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
[✓] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [1,243ms]
• Android SDK at /Users/deanli/Library/Android/sdk
• Emulator version 36.2.12.0 (build_id 14214601) (CL:N/A)
• Platform android-36.1, build-tools 36.1.0
• Java binary at: /Users/deanli/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.8+-14196175-b1038.72)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 26.2) [692ms]
• Xcode at /Applications/Xcode-26.2.0-beta.app/Contents/Developer
• Build 17C5013i
• CocoaPods version 1.16.2
[✓] Chrome - develop for the web [5ms]
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Connected device (4 available) [6.1s]
• Dean iPad (wireless) (mobile) • 00008103-000825C811E3401E • ios • iOS 26.1 23B5059e
• iPhone 16 Pro Max (mobile) • 00008140-00194CC23A68801C • ios • iOS 26.1 23B82
• macOS (desktop) • macos • darwin-arm64 • macOS 26.2 25C5031i darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 142.0.7444.135
! Error: Browsing on the local area network for Nexus. Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources [624ms]
• All expected network resources are available.
! Doctor found issues in 1 category.
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 -v and a minimal reproduction of the issue.
Activity
ulisseshen commentedon Nov 6, 2025
Should you provide Flutter Doctor output and also a minimum reproducible example that what are you facing?
vikasdwivedi-kuhoo commentedon Nov 6, 2025
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.35.0, on macOS 26.0.1 25A362 darwin-arm64, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 26.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.95.3)
@ulisseshen Flutter doctor summary
On Web we use TextFormField. Our users copy text from a file and try to paste it in our TextFormField, but it loses focus as soon as they switch the tab or minimize our Web App on Chrome browser.
[-]Flutter Web - TextFormField losing focus after it goes to background, for example on a tab switch[/-][+]Flutter Web (Chrome browser) - TextFormField losing focus after it goes to background, for example on a tab switch[/+]danagbemava-nc commentedon Nov 7, 2025
Hi @vikasdwivedi-kuhoo, thanks for filing this issue. To make it easier for us to determine what broke this behavior, kindly tell us which version of flutter you were on before you upgraded to 3.35.0
Thank you
vikasdwivedi-kuhoo commentedon Nov 7, 2025
@danagbemava-nc Our previous version was 3.29.3, Just fyi this is working fine on Firefox and Safari.
danagbemava-nc commentedon Nov 10, 2025
Reproducible using the steps outlined above. Can confirm this is a regression as it worked as expected on stable 3.32.8 but not the latest stable & master.
In my testing, it appeared to work on Safari but not Firefox and Chrome.
Bisected this to #166804
Labeling this for further insight
Screen.Recording.2025-11-10.at.6.28.52.AM.mov
Screen.Recording.2025-11-10.at.6.29.49.AM.mov
code sample
flutter doctor -v
13 remaining items
fix(ci): Pin stable web e2e to Flutter 3.41.9
fix(authenticator): Make web e2e resilient to focus-traversal regression
fix(authenticator): Make web e2e resilient to focus-traversal regression
fix(authenticator): Make web e2e resilient to focus-traversal regress…
[web] Preserve text field focus across tab switches (flutter#188738)
github-actions commentedon Jul 24, 2026
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.flutter-zl commentedon Aug 12, 2026
Reopen this because #188738 works on Safari not Chrome.
The issue is reproducible with https://flutter-demo-45-after.web.app/ on chrome.
flutter-zl commentedon Aug 12, 2026
I redeployed https://flutter-demo-45-after.web.app with current master and it works on chrome and safari.