Skip to content

[web][Safari-iOS][Chrome-Android] TextField cursor doesn't move to the clicked position #95958

@lyf571321556

Description

@lyf571321556
Code sample
TextField(
                autofocus: true,
                textAlign: TextAlign.left,
                style: globalNavigatorKey.textTheme.bodyText1,
                obscureText: false,
                autocorrect: false,
                enableSuggestions: false,
                controller: _inputController,
                focusNode: _textFieldFocusNode,
                keyboardType: TextInputType.text,
                onChanged: (newValue) {
                  setState(() {
                    if (newValue != null &&
                        newValue.endsWith("@") &&
                        lastestInputLength < newValue.length) {
                      _navigateToUserSelection();
                    }
                  });
                  lastestInputLength = newValue?.length;
                },
                decoration: InputDecoration(
                    isDense: true,
                    contentPadding: const EdgeInsets.symmetric(
                        vertical: 10, horizontal: 10),
                    focusedBorder: const OutlineInputBorder(
                        borderRadius: BorderRadius.all(Radius.circular(4.0)),
                        borderSide: BorderSide(
                            color: OnesColors.primaryBlue, width: 1.0)),
                    enabledBorder: const OutlineInputBorder(
                        borderRadius: BorderRadius.all(Radius.circular(4.0)),
                        borderSide: BorderSide(
                            color: OnesColors.lightGray, width: 1.0)),
                    disabledBorder: const OutlineInputBorder(
                        borderRadius: BorderRadius.all(Radius.circular(4.0)),
                        borderSide: BorderSide(
                            color: OnesColors.lightGray, width: 1.0)),
//                        border: OutlineInputBorder(borderRadius: BorderRadius.all(Radius.circular(4.0)),borderSide: BorderSide(color: OnesColors.LoginPageTitleBackGround, width: 1.0)),
                    hintText: "",
                    hintStyle: globalNavigatorKey.textTheme.bodyText1
                        .copyWith(color: OnesColors.lightGray)),
//            maxLength: 500,
                minLines: 6,
                maxLines: 6,
              )
Logs
Analyzing xxxx...                                                
No issues found! (ran in 4.6s)

╰ flutter doctor -v
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.5.1 20G80 darwin-arm, locale
    zh-Hans-CN)
    • Flutter version 2.2.3 at /Users/ones/Library/flutter
    • Framework revision f4abaa0735 (6 months ago), 2021-07-01 12:46:11 -0700
    • Engine revision 241c87ad80
    • Dart version 2.13.4
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[!] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/ones/Library/Android/sdk
    • Platform android-30, build-tools 31.0.0
    • ANDROID_HOME = /Users/ones/Library/Android/sdk
    • ANDROID_SDK_ROOT = /Users/ones/Library/Android/sdk
    • Java binary at: bin/java
    ✗ Cannot execute bin/java to determine the version

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

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

[!] Android Studio (not installed)
    • Android Studio not found; download from
      https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup
      for detailed instructions).
1111000.mov

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsbrowser: chrome-androidonly manifests in Chrome on Androidbrowser: safari-iosonly manifests in Safari on iOSengineflutter/engine related. See also e: labels.found in release: 3.7Found to occur in 3.7found in release: 3.9Found to occur in 3.9has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyteam-webOwned by Web platform teamtriaged-webTriaged by Web platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions