Skip to content

Double click and drag #99071

@justinmc

Description

@justinmc

Flutter doesn't correctly support double click and drag to select by word.

To reproduce

  1. Run any app with a text input or selectable text (such as the one given below).
  2. Double click some text, but don't release the second click.
  3. Drag to a new part of the text.

Expected: The selection is expanded or extended word-by-word (tried on TextEdit and Chrome on a Mac) in both directions.
Actual: The text is extended character-by-character and stops in the reverse direction.

TextEdit on Mac Flutter on Mac
mac_double_click_drag flutter_double_click_drag
Code
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({
    Key? key,
  }) : super(key: key);

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: fidelityMatching the OEM platforms bettera: text inputEntering text in a text field or keyboard related problemsfound in release: 2.10Found to occur in 2.10found in release: 2.11Found to occur in 2.11frameworkflutter/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