Skip to content

[IOS] TextField Focus doesn't work correctly on the web #91755

@Oleh-Sv

Description

@Oleh-Sv

Steps to Reproduce

class VerifyPage extends StatelessWidget {
  const VerifyPage({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      body: Column(
        children: [
          Container(
            color: Colors.red,
            height: 300,
          ),
          TextField(),
        ],
      ),
    );
  }
}
  1. Execute flutter run on the code sample
  2. Connect to localhost from simulator or iPhone with iOS 15

Expected results:

  1. Tap on field opens keyboard and give focus to text field
  2. Tap on done removes focus of text field and close keyboard

Actual results:

  1. Tap on field opens keyboard and give focus to text field
  2. Tap on done only closes keyboard but field still have focus
  3. Second tap on field opens keyboard but also has side effect Safari scroll all content of page (you can notice as part of red rectangle is hidden under top of screen)
Flutter analyze
    oleh@imac web % flutter analyze 
    Analyzing web...                                                        
    No issues found! (ran in 4.9s)
Flutter doctor
[✓] Flutter (Channel stable, 2.5.2, on macOS 11.6 20G165 darwin-x64, locale en-GB)
    • Flutter version 2.5.2 at /Users/oleh/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 3595343e20 (13 days ago), 2021-09-30 12:58:18 -0700
    • Engine revision 6ac856380f
    • Dart version 2.14.3

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/oleh/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 13.0, Build version 13A233
    • CocoaPods version 1.10.1

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

[✓] Android Studio (version 2020.3)
    • 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.10+0-b96-7281165)

[✓] VS Code (version 1.61.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.27.0

[✓] Connected device (4 available)
    • iPhone 8 (mobile)  • 552087D1-B32C-4F69-B94D-9F1514953C66 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator)
    • iPhone 11 (mobile) • A2D44F05-4C40-4319-93F4-CC9095DE19C5 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator)
    • macOS (desktop)    • macos                                • darwin-x64     • macOS 11.6 20G165 darwin-x64
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome 94.0.4606.81
Screen.Recording.2021-10-13.at.19.39.27.mov

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: text inputEntering text in a text field or keyboard related problemsbrowser: safari-iosonly manifests in Safari on iOSf: focusFocus traversal, gaining or losing focusf: material designflutter/packages/flutter/material repository.found in release: 2.5Found to occur in 2.5found in release: 2.6Found to occur in 2.6frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyplatform-webWeb applications specificallyr: solvedIssue is closed as solved

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions