Skip to content

TextInput spell check doesn't work great on iOS #124882

Closed

Description

@leighajarett

Is there an existing issue for this?

Steps to reproduce

Use the following widget on any Flutter iOS app (on >3.10)

TextField(spellCheckConfiguration: SpellCheckConfiguration()),)

Type in "hel", press space, and then click on the text once there is a red line underneath

Expected results

Screenshot 2023-04-14 at 3 06 50 PM

I would expect that TextField either:

  • Uses the default iOS-style of spellcheck suggestions by default (as shown above)
  • Or has some way to customize the spellcheck suggestions so a developer can manually make them look correct on iOS

Actual results

image

Responses are overflowing and the iOS context menu is not used.

Overall this isn't a great experience for our developers. As Tao mentioned, the different APIs for TextField and CupertinoTextField make it difficult to adapt between the two in a single app. However, developers have frequently noted that text input should "feel native" on platforms, and we know most of our developers are deploying to both Android and iOS.

Code sample

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        useMaterial3: true,
      ),
      home: Scaffold(
        body: Center(
            child: TextField(
          spellCheckConfiguration: SpellCheckConfiguration(),
        )),
      ),
    );
  }
}

Screenshots or Video

No response

Logs

No response

Flutter Doctor output

Doctor output
[✓] Flutter (Channel master, 3.10.0-6.0.pre.9, on macOS 13.3.1 22E261 darwin-arm64, locale en)
    • Flutter version 3.10.0-6.0.pre.9 on channel master at /Users/leighaj/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 119744a63c (2 hours ago), 2023-04-14 10:43:17 -0700
    • Engine revision ea0e1b1700
    • Dart version 3.1.0 (build 3.1.0-4.0.dev)
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
    • Android SDK at /Users/leighaj/Library/Android/sdk
    • Platform android-33, build-tools 33.0.2
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)
    • 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
    • Java version OpenJDK Runtime Environment (build 11.0.15+0-b2043.56-8887301)

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

[✓] Connected device (3 available)
    • iPhone 14 (mobile) • 2737695B-AB22-46E3-A8B2-F6AA3514A477 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-16-2
      (simulator)
    • macOS (desktop)    • macos                                • darwin-arm64   • macOS 13.3.1 22E261 darwin-arm64
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome 112.0.5615.49

[✓] Network resources
    • All expected network resources are available.

• No issues found!```

</details>

Activity

  1. added
    a: text inputEntering text in a text field or keyboard related problems
    platform-iosiOS applications specifically
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Apr 14, 2023
  2. self-assigned this
    on Apr 14, 2023
  3. added
    P1High-priority issues at the top of the work list
    on Apr 18, 2023
  4. justinmc commented on Apr 24, 2023

    @justinmc
    Contributor

    I've merged three PRs related to this and am waiting on one last one (all linked above). When merged this will be the behavior and I'll close this issue if no one objects:

    Screenshot Video
    Screen.Recording.2023-04-24.at.11.44.23.AM.mov
  5. leighajarett commented on Apr 24, 2023

    @leighajarett
    ContributorAuthor

    @justinmc LGTM - so just to confirm, this uses the same Cupertino-style word suggestions (like if there are multiple suggestions, it will show the top 3 separated by vertical dividers) ?

  6. justinmc commented on Apr 24, 2023

    @justinmc
    Contributor

    That's right, here are some screenshots for the other cases:

    2 3 or more 0
    Screenshot 2023-04-24 at 1 59 21 PM Screenshot 2023-04-24 at 2 00 02 PM Screenshot 2023-04-24 at 1 59 48 PM
  7. github-actions commented on May 9, 2023

    @github-actions

    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.

  8. locked as resolved and limited conversation to collaborators on May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work lista: text inputEntering text in a text field or keyboard related problemsframeworkflutter/packages/flutter repository. See also f: labels.platform-iosiOS applications specifically

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions