Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Select All" Automatically scrolls EditableText to the end of the text field, which doesn't happen on native iOS #105731

Closed
antholeole opened this issue Jun 9, 2022 · 3 comments
Assignees
Labels
a: fidelity Matching the OEM platforms better a: text input Entering text in a text field or keyboard related problems engine flutter/engine repository. See also e: labels. found in release: 3.0 Found to occur in 3.0 found in release: 3.1 Found to occur in 3.1 has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-ios iOS applications specifically r: fixed Issue is closed as already fixed in a newer version

Comments

@antholeole
Copy link
Contributor

Steps to Reproduce

code sample:

class MyApp extends StatelessWidget {
  final textController =
      TextEditingController(text: lorem(words: 50, paragraphs: 2)); //or just manually input a lot of text, enough to overflow

  MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
          body: Center(
              child: FractionallySizedBox(
        widthFactor: 0.4,
        child: TextField(
          controller: textController,
        ),
      ))),
    );
  }
}
  1. Flutter Run
  2. Long Press on the text Field
  3. Select "Select All"

Expected results:

Should behave like native and not scroll to the end: https://user-images.githubusercontent.com/48811365/172933065-ef0a267a-f5fe-4f8a-a37d-7001ceb6fc11.gif

Actual results:

Flutter automatically scrolls to the end:
https://user-images.githubusercontent.com/48811365/172933198-4aed8242-3da4-4366-b4b6-f4a3ae283cfb.gif

I'll probably just fix this along with #104945 since to fix that this one needs to be fixed, because we can calculate the correct position for the toolbar but it won't be in view anyway

@antholeole antholeole self-assigned this Jun 9, 2022
@antholeole antholeole changed the title "Select All" Automatically scrolls EditableText to the end of the text field, which doesn't happen on native "Select All" Automatically scrolls EditableText to the end of the text field, which doesn't happen on native iOS Jun 9, 2022
@danagbemava-nc danagbemava-nc added the in triage Presently being triaged by the triage team label Jun 10, 2022
@danagbemava-nc
Copy link
Member

Issue is reproducible on stable and master.

recordings
flutter reminders app
Simulator.Screen.Recording.-.iPhone.13.-.2022-06-10.at.07.23.37.mp4
Simulator.Screen.Recording.-.iPhone.13.-.2022-06-10.at.07.22.27.mp4
complete sample
import 'package:flutter/material.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  final textController = TextEditingController(
      text: """Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas eu rutrum nibh. Duis sed purus non tortor tempor iaculis. Cras sit amet metus eget ex convallis imperdiet eget eu mauris. Suspendisse placerat nulla non justo commodo, non dictum purus tristique. Nam non congue velit, non accumsan eros. Proin commodo ultricies nisi. Aliquam id iaculis quam, scelerisque pharetra ante. Aliquam ut dui sit amet magna posuere venenatis id sit amet nibh. Interdum et malesuada fames ac ante ipsum primis in faucibus. Duis gravida purus a blandit condimentum. Maecenas dapibus venenatis nibh. Etiam blandit augue quis ligula consectetur euismod.Quisque ultrices volutpat condimentum. Nunc egestas mollis magna ac blandit. Sed in venenatis augue, ac gravida nulla. Vivamus tortor ipsum, accumsan et ante non, egestas aliquam mi. Proin tellus nibh, viverra et tempus vitae, congue vitae lectus. Proin suscipit molestie velit, a varius neque lacinia vitae. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas."); //or just manually input a lot of text, enough to overflow""");

  MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        body: Center(
          child: FractionallySizedBox(
            widthFactor: 0.8,
            child: TextField(
              controller: textController,
              maxLines: 5,
            ),
          ),
        ),
      ),
    );
  }
}
flutter doctor -v
[✓] Flutter (Channel stable, 3.0.1, on macOS 12.3.1 21E258 darwin-arm, locale en-GB)
    • Flutter version 3.0.1 at /Users/nexus/dev/sdks/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision fb57da5f94 (3 weeks ago), 2022-05-19 15:50:29 -0700
    • Engine revision caaafc5604
    • Dart version 2.17.1
    • DevTools version 2.12.2

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-32, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 2021.2)
    • 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.12+0-b1504.28-7817840)

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

[✓] Connected device (3 available)
    • iPhone 13 (mobile) • DBB48503-41CE-4969-9043-3261726E438A • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-4 (simulator)
    • macOS (desktop)    • macos                                • darwin-arm64   • macOS 12.3.1 21E258 darwin-arm
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome 102.0.5005.61
    ! Error: Nexus is not connected. Xcode will continue when Nexus is connected. (code -13)

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

• No issues found!
[✓] Flutter (Channel master, 3.1.0-0.0.pre.1211, on macOS 12.3.1 21E258 darwin-arm, locale en-GB)
    • Flutter version 3.1.0-0.0.pre.1211 at /Users/nexus/dev/sdks/flutters
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 9d46e7800f (4 hours ago), 2022-06-09 23:43:08 -0400
    • Engine revision a4cdb1e232
    • Dart version 2.18.0 (build 2.18.0-174.0.dev)
    • DevTools version 2.14.0

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /Users/nexus/Library/Android/sdk
    • Platform android-32, build-tools 31.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

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

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

[✓] Android Studio (version 2021.2)
    • 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.12+0-b1504.28-7817840)

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

[✓] Connected device (3 available)
    • iPhone 13 (mobile) • DBB48503-41CE-4969-9043-3261726E438A • ios            • com.apple.CoreSimulator.SimRuntime.iOS-15-4 (simulator)
    • macOS (desktop)    • macos                                • darwin-arm64   • macOS 12.3.1 21E258 darwin-arm
    • Chrome (web)       • chrome                               • web-javascript • Google Chrome 102.0.5005.61
    ! Error: Nexus is not connected. Xcode will continue when Nexus is connected. (code -13)

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

• No issues found!

@danagbemava-nc danagbemava-nc added a: text input Entering text in a text field or keyboard related problems platform-ios iOS applications specifically engine flutter/engine repository. See also e: labels. a: fidelity Matching the OEM platforms better has reproducible steps The issue has been confirmed reproducible and is ready to work on found in release: 3.0 Found to occur in 3.0 found in release: 3.1 Found to occur in 3.1 and removed in triage Presently being triaged by the triage team labels Jun 10, 2022
@chinmaygarde chinmaygarde added the P2 Important issues not at the top of the work list label Jun 13, 2022
@antholeole
Copy link
Contributor Author

closed by #105799

@danagbemava-nc danagbemava-nc added the r: fixed Issue is closed as already fixed in a newer version label Aug 1, 2022
@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: fidelity Matching the OEM platforms better a: text input Entering text in a text field or keyboard related problems engine flutter/engine repository. See also e: labels. found in release: 3.0 Found to occur in 3.0 found in release: 3.1 Found to occur in 3.1 has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-ios iOS applications specifically r: fixed Issue is closed as already fixed in a newer version
Projects
None yet
Development

No branches or pull requests

3 participants