Skip to content

MacOS move selection by line inconsistency #79291

Closed

Description

@justinmc

The cmd + left/right arrow shortcut is able to jump between lines in Flutter, but when using TextEdit on Mac, the cursor stops at the beginning/end of the line and isn't able to change lines.

Steps to reproduce

  1. Run an app with a multi-line text field, such as the one below, on a Mac.
  2. Type a few lines of text and put the cursor at the end.
  3. Hold the cmd key and press the left arrow twice.

Expected results: When doing this in TextEdit, the second keypress has no effect. The first one moves the cursor to the start of the last line, and the second one does nothing.

Actual results: The cursor moves to the start of the second to last line.

Code
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: Scaffold(
        appBar: AppBar(
          title: Text('Flutter Demo'),
        ),
        body: Center(
          child: TextField(
            maxLines: 5,
          ),
        ),
      ),
    );
  }
}

Activity

  1. TahaTesser commented on Mar 30, 2021

    @TahaTesser
    Contributor
    flutter doctor -v
    [✓] Flutter (Channel master, 2.1.0-13.0.pre.322, on macOS 11.2.3 20D91
        darwin-x64, locale en-GB)
        • Flutter version 2.1.0-13.0.pre.322 at
          /Users/tahatesser/Code/flutter_master
        • Framework revision e93590474d (2 hours ago), 2021-03-30 02:14:03 -0400
        • Engine revision dbcbf69a57
        • Dart version 2.13.0 (build 2.13.0-175.0.dev)
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
        • Android SDK at /Volumes/Extreme/SDK
        • Platform android-30, build-tools 30.0.3
        • ANDROID_HOME = /Volumes/Extreme/SDK
        • Java binary at: /Applications/Android
          Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build
          1.8.0_242-release-1644-b3-6915495)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS
        • Xcode at /Volumes/Extreme/Xcode.app/Contents/Developer
        • Xcode 12.4, Build version 12D4e
        • CocoaPods version 1.10.1
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 4.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
          1.8.0_242-release-1644-b3-6915495)
    
    [✓] VS Code (version 1.54.3)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.20.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-x64     • macOS 11.2.3 20D91 darwin-x64
        • Chrome (web)    • chrome • web-javascript • Google Chrome 89.0.4389.90
    
    • No issues found!
  2. added
    a: text inputEntering text in a text field or keyboard related problems
    p: material_uimaterial_ui package in flutter/packages
    frameworkflutter/packages/flutter repository. See also f: labels.
    has reproducible stepsThe issue has been confirmed reproducible and is ready to work on
    platform-macosBuilding on or for macOS specifically
    and removed
    in triagePresently being triaged by the triage team
    on Mar 30, 2021
  3. gspencergoog commented on Apr 1, 2021

    @gspencergoog
    Contributor
  4. added
    P2Important issues not at the top of the work list
    on Apr 1, 2021
  5. justinmc commented on Apr 1, 2021

    @justinmc
    ContributorAuthor

    This should also do the same thing when deleting by line on Mac. The fix should be the same. See #77172 (comment).

  6. added
    r: fixedIssue is closed as already fixed in a newer version
    on Aug 27, 2021
  7. github-actions commented on Sep 10, 2021

    @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 Sep 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: desktopRunning on desktopa: text inputEntering text in a text field or keyboard related problemsfound in release: 2.1Found to occur in 2.1frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesplatform-macosBuilding on or for macOS specificallyr: fixedIssue is closed as already fixed in a newer version

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions