Skip to content

[Desktop]TextField cursor can be dragged with a mouse #102928

@justinmc

Description

@justinmc

On mobile, you can tap and drag the cursor, but it seems like that behavior hasn't been disabled when using a mouse:

out

Steps to reproduce

  1. Run any app with a TextField, such as the one given below, on a device with a mouse.
  2. Paste or type some text into the field.
  3. Click and drag directly on top of the cursor.

Expected: A selection begins.
Actual: The cursor moves along with the mouse.

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

Labels

P2Important issues not at the top of the work lista: desktopRunning on desktopa: text inputEntering text in a text field or keyboard related problemsc: regressionIt was better in the past than it is nowfound in release: 2.13Found to occur in 2.13has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: 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