Skip to content

Mouse can't select text in a multi-line textfield #55627

@WG-Studios

Description

@WG-Studios

Steps to Reproduce

Dartpad Example: https://dartpad.dev/c377b45f28f1cd60f23c5ddef9c88524

  1. Run flutter create bug.
  2. Update the files as follows:
    main.dart:
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: MyWidget(),
        ),
      ),
    );
  }
}

class MyWidget extends StatefulWidget {
  createState() => MyWidgetState();
}

class MyWidgetState extends State<MyWidget> {
  TextEditingController _cont1;
  TextEditingController _cont2;

  @override
  initState() {
    _cont1 = TextEditingController();
    _cont2 = TextEditingController();

    _cont1.text = 'Text selection works here';
    _cont2.text = 'Text selection does not work\nwhen text is multi-line.';
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        TextField(controller: _cont1),
        TextField(controller: _cont2, maxLines: null),
      ],
    );
  }
}
  1. On flutter web, I can not select text with the mouse on the multi-line text field.

Expected results:
success

Actual results:
fail

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemscustomer: crowdAffects or could affect many people, though not necessarily a specific customer.found in release: 1.20Found to occur in 1.20found in release: 1.21Found to occur in 1.21frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specifically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions