Repository navigation
Cursor should collapse after a paste #98677
Copy link
Copy link
Closed
Labels
a: fidelityMatching the OEM platforms betterMatching the OEM platforms bettera: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsfound in release: 2.10Found to occur in 2.10Found to occur in 2.10found in release: 2.11Found to occur in 2.11Found to occur in 2.11frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Description
When pasting onto a non-collapsed selection, the selection should collapse. Confirmed on native Mac, Windows, Android and iOS. I'd be shocked if Linux isn't the same too.
If you paste with the keyboard while the cursor is offscreen, the cursor should be scrolled into view, but it isn't.
Steps to reproduce
- Run any app with a text field, such as the one below.
- Enter some text, like "asdf".
- Copy any text.
- Make any selection of length > 0.
- Paste (using the keyboard or using the toolbar).
Expected: The cursor ends up collapsed at the end of the pasted text.
Actual: The pasted text is selected.
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(),
),
),
);
}
}Related: #98604 (comment)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
a: fidelityMatching the OEM platforms betterMatching the OEM platforms bettera: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsfound in release: 2.10Found to occur in 2.10Found to occur in 2.10found in release: 2.11Found to occur in 2.11Found to occur in 2.11frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer version
Activity
maheshj01 commentedon Feb 18, 2022
Hi @justinmc, I am able to reproduce this issue on Linux and mac on both stable and the master channel. The pasted text remains selected and the cursor doesn't show up as it should compared to native platforms.
output
MacOS
Screen.Recording.2022-02-18.at.3.13.10.PM.mov
linux.mp4
IOS
Screen.Recording.2022-02-18.at.3.08.42.PM.mov
Android
Screen.Recording.2022-02-18.at.2.08.37.PM.mov
Screen.Recording.2022-02-18.at.2.10.48.PM.mov
flutter doctor -v (macos)
flutter doctor -v (Linux)
github-actions commentedon Mar 11, 2022
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 -vand a minimal reproduction of the issue.