Skip to content

MacOS move selection by line inconsistency #79291

@justinmc

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,
          ),
        ),
      ),
    );
  }
}

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 problemsf: material designflutter/packages/flutter/material repository.found 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 onplatform-macBuilding 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