-
Notifications
You must be signed in to change notification settings - Fork 28.6k
[flutter_markdown]: rendered text is not selectable #91524
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
Comments
Using below code sample, the text doesn't seem to be selectable: code sample
|
@andrewschmidt-a |
Triage ReportI was not able to reproduce the issue using the provided code sample on either the You need to set flutter_markdown - 0.7.7+1Screen.Recording.2025-05-16.at.10.57.51.PM.mov❗ However on iOS (master) I noticed a different issue. I'll file a new issue separately.
This new issue doesn't happen for MacOS, Web or Android. Code Sampleimport 'package:flutter/material.dart';
import 'package:flutter_markdown/flutter_markdown.dart';
void main() {
runApp(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: MinimalMarkdownDemo(),
);
}
}
const String _data = '''
# Minimal Markdown Test
---
This is a simple Markdown test. Provide a text string with Markdown tags
to the Markdown widget and it will display the formatted output in a scrollable
widget.
## Section 1
Maecenas eget **arcu egestas**, mollis ex vitae, posuere magna. Nunc eget
aliquam tortor. Vestibulum porta sodales efficitur. Mauris interdum turpis
eget est condimentum, vitae porttitor diam ornare.
### Subsection A
Sed et massa finibus, blandit massa vel, vulputate velit. Vestibulum vitae
venenatis libero. ***Curabitur sem lectus, feugiat eu justo in, eleifend
accumsan ante.*** Sed a fermentum elit. Curabitur sodales metus id mi ornare,
in ullamcorper magna congue.
''';
class MinimalMarkdownDemo extends StatelessWidget {
const MinimalMarkdownDemo({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text('Markdown Demo')),
body: MarkdownBody(
selectable: true,
styleSheet: MarkdownStyleSheet(
h1Align: WrapAlignment.center,
h2Align: WrapAlignment.end,
),
data: _data,
),
);
}
} stable (3.29.3) - flutter doctor -v
master (3.33.0-1.0.pre.107) - flutter doctor -v
I'm closing this issue as the original problem is not reproducible. |
https://googleflutter.com/flutter-selectabletext/
Why not make the Text selectable by default. This seems to make sense for content.
The text was updated successfully, but these errors were encountered: