New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SelectionArea
does not copy the text sometimes
#104549
Comments
is this Linux only? I can't seem to reproduce it in macOS |
I'm using a MacBook M1 with macOS 12.2.1 (21D62) |
just want to double check you meant cmd+c and not ctrl+c right? For me it works correctly |
I used CMD + C 😅 |
Right now I am trying to copy text on my Linux machine, but it's not working, right click and copy works but ctrl+c is not working |
When I remember correctly the same was for me. Right click and copy worked but cmd + c not. But I'm not 100% sure about this. |
SelecationArea
does not copy the text sometimesSelectionArea
does not copy the text sometimes
I was able to reproduce this issue on web running on MacOS. Though after the one time I did, I couldn't reproduce it again. Luckily, I took a video of the behavior I experienced which matches with @nilsreichardt. Video104549_web_master.movCode sampleimport 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
title: 'Multiline text copy demo',
home: HomePage(),
);
}
}
class HomePage extends StatelessWidget {
const HomePage({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text('Multiline text copy demo')),
body: SelectionArea(
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'This is a title',
style: Theme.of(context).textTheme.headline6,
),
const SizedBox(height: 20),
const Text(
'Lorem ipsum dolor sit amet, consectetur adipiscing elit. '
'Fusce gravida sollicitudin.',
),
],
),
),
),
);
}
}
|
so everyone has the issue for the first time... I have a feeling there maybe some bug in the flutter tool or embedding. The copy uses the same mechanism TextFields are using, I wonder if similar issue happens to the TextField |
This issue still relevent but it happens with Text.rich widget with TextSpans. 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: Scaffold(
body: SelectionArea(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: const <Widget>[
SelectionArea(
child: Text.rich(
TextSpan(
text: 'test span. ',
children: [
TextSpan(
text: 'another text span',
)
],
),
),
),
TextField(),
],
),
)),
);
}
} I've tested on windows and linux both debug and release builds, flutter version 3.7.1 |
Any update on this? While on Chrome in Mac , I can't copy with keyboard shortcut (CMD + C), but I can copy by right clicking and pressing copy 🤔 |
Check here maybe you can find solution. #104548 (comment) |
I can confirm the comment by @justinmc:
#95226 (review)
Here is my screen recording.
Screen.Recording.2022-05-24.at.23.50.19.mov
I used CRTL + C to copy my text but it didn't work. I removed the
ElevatedButton
, used hot restart and it worked again. Adding theElevatedButton
, used hot restart and it worked again 🤔I used the commit
577d6240dbcdbd3cd00e9b4a8c4564e70279f014
as Flutter SDK (the latest commit of @chunhtai branchinherited-selection
).My app
@chunhtai Unfortunately, I don't have more information because I couldn't reproduce it anymore. But when I know more, I will post it here :)
The text was updated successfully, but these errors were encountered: