Skip to content

Dragging while the text selection toolbar is up should close it #106820

Closed

Description

@justinmc

On Flutter desktop, it's currently possible to keep the text selection toolbar open and updating while you drag some selection around:

out

Steps to reproduce

  1. Run an app with a text input, such as the example below, on desktop.
  2. Right click somewhere on the text to open the text selection toolbar.
  3. Left click and drag somewhere else on the text.

Expected: The menu closes and selection does not change (tested on Linux).
Actual: The menu stays open and selection begins.

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: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

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

  final String title;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(title),
      ),
      body: const Center(
        child: TextField(),
      ),
    );
  }
}

Activity

  1. added
    a: text inputEntering text in a text field or keyboard related problems
    on Jun 29, 2022
  2. added
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Jun 30, 2022
  3. self-assigned this
    on Jun 30, 2022
  4. TahaTesser commented on Jun 30, 2022

    @TahaTesser
    Contributor

    investigated this, looks like an easy fix, need to write test tho.

  5. added
    P2Important issues not at the top of the work list
    on Jun 30, 2022
  6. added
    r: fixedIssue is closed as already fixed in a newer version
    on Jul 18, 2022
  7. moved this to Done (PR merged) in Nevercodeon Jul 18, 2022
  8. github-actions commented on Aug 1, 2022

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  9. locked as resolved and limited conversation to collaborators on Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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 problemsframeworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

  • Status
    Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions