Skip to content

[Android] It's possible to show the touch selection handles when using a mouse #168252

@justinmc

Description

@justinmc

On native Android apps, when using a mouse, the selection handles don't show. However on Flutter, it's possible to get them to show up.

Steps to reproduce:

  1. Get an Android device and connect a mouse to it.
  2. Run an app with a text field, such as the one below.
  3. Enter some text.
  4. Right click.
  5. Press "Select all"

Expected results

All the text is highlighted and no selection handles are shown.

Actual results

All the text is highlighted but selection handles appear.

Image

Code
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(title),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: const <Widget>[
            TextField(),
          ],
        ),
      ),
    );
  }
}

Metadata

Metadata

Labels

P2Important issues not at the top of the work lista: mouseIssues related to using a mouse or mouse supporta: text inputEntering text in a text field or keyboard related problemsc: new featureNothing broken; request for a new capabilityfound in release: 3.29Found to occur in 3.29found in release: 3.32Found to occur in 3.32has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions