Skip to content

Windows word modifier inconsistencies #78572

@justinmc

Description

@justinmc

On Windows, navigating through text with the arrow keys while holding control behaves slightly differently than other platforms, and Flutter misses this. Windows jumps to the start of the next word in either direction, while other platforms jump to the end of words when moving right and the beginning of words when moving left.

Steps to Reproduce

  1. Run the app below on Windows, which is just a TextField with "word word word" in it.
  2. Focus the field and put the cursor at the start.
  3. Hold the word modifier key (ctrl on Windows, option on Mac) and press the right arrow key.

Expected results: "word |word word"

Actual results: "word| word word"

This is the correct behavior on all other platforms, but not on Windows.

Code
import 'package:flutter/material.dart';
 
void main() {
  runApp(MyApp());
}
 
class MyApp extends StatelessWidget {
  final TextEditingController controller = TextEditingController(text: 'word word word');

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: TextField(
            controller: controller,
          ),
        ),
      ),
    );
  }
}

Test on Windows 10 using Notepad.

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 onplatform-windowsBuilding on or for Windows specificallyteam-windowsOwned by the Windows platform teamtriaged-windowsTriaged by the Windows platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions