-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Closed
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: typographyText rendering, possibly libtxtText rendering, possibly libtxtf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.f: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.f: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsfound in release: 2.5Found to occur in 2.5Found to occur in 2.5found in release: 2.6Found to occur in 2.6Found to occur in 2.6frameworkflutter/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 onteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages teamwaiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds
Description
Initial Information
Suppose I have a full-height container with only SelectableText widget inside which will fill the height of container. Inside the widget is a long text (for example 6 paragraphs of Lorem Ipsum) so naturally the widget will be scrollable and some text will be obscured.
Sample code:
class Sample extends StatefulWidget {
Sample ({Key key}) : super(key: key);
@override
_Sample State createState() => _Sample State();
}
class _Sample State extends State<Sample> {
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Container(
child: SelectableText(
...long text here...
),
),
),
);
}
}
Steps to Reproduce
CASE 1
- After page finishes building, select a word at the beginning of the text by long pressing it.
- Cancel selection by tapping anywhere on the text.
- Scroll down until the previously selected word gets obscured (In this case, to max scroll offset).
- Select a word by again long pressing it.
CASE 2
- After page finishes building, scroll down to max scroll offset.
- Select a word by long pressing it.
- Cancel selection by tapping anywhere on the text.
- Scroll up until previously selected word is obscured (In this case, to min scroll offset).
- Select a word by again long pressing it.
Expected results:
The word is highlighted.
Actual results:
CASE 1 and CASE 2
The word is highlighted, but;
Widget gets jumpy and scrolls in the direction of where the initially selected word is located on screen.
Additional Info
Issue only happens when I select a word by long-pressing it. This doesn't happen if I double tap on it.
Issue also happens on SelectableText.rich widget.
Logs
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel unknown, 2.5.0, on Microsoft Windows [Version 10.0.18363.1256], locale en-ID)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 2020.3)
[√] VS Code (version 1.60.2)
[√] Connected device (2 available)
windows7lake, CPMoviePHil, tyz910, kreativityapps, pacifio and 4 more
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: typographyText rendering, possibly libtxtText rendering, possibly libtxtf: material designflutter/packages/flutter/material repository.flutter/packages/flutter/material repository.f: scrollingViewports, list views, slivers, etc.Viewports, list views, slivers, etc.f: selectionSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsSelectableRegion, SelectionArea, SelectionContainer, Selectable, and related APIsfound in release: 2.5Found to occur in 2.5Found to occur in 2.5found in release: 2.6Found to occur in 2.6Found to occur in 2.6frameworkflutter/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 onteam-designOwned by Design Languages teamOwned by Design Languages teamtriaged-designTriaged by Design Languages teamTriaged by Design Languages teamwaiting for customer responseThe Flutter team cannot make further progress on this issue until the original reporter respondsThe Flutter team cannot make further progress on this issue until the original reporter responds