Repository navigation
text selection toolbar over flow ! #35826
Description
Activity
- addeda: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsp: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagesframeworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.
on Jul 9, 2019 Thanks for the issue @mosala7. Can you post the code that reproduces the overflow?
Thanks for the issue @mosala7. Can you post the code that reproduces the overflow?
Thanks for notifying me, code updated in the issue.
I am experiencing the same problem. Material toolbar overflows almost every time when using russian localization (because words are quite long). Wrapping _TextSelectionToolbar in SingleChildScrollView with horizontal scroll axis could help (/material/text_selection.dart:176).
@westracer Does this happen on native Android as well with a Russian locale? Does native handle it by scrolling the menu horizontally?
It seems like we should definitely handle the possibility of the selection menu being wider than the screen. I don't see this happening on a simulated Pixel 2, but I imagine it could be common on narrower phones and other locales.
@justinmc Yes, it happens. I've seen multiple ways to handle overflow on native Android. For example, rendering "more" button that shows overflowed buttons in a dropdown list ( https://i.imgur.com/Up9iMZj.png https://i.imgur.com/p6tjkjB.png ), making whole toolbar scrollable or just clipping text and removing padding for every toolbar button.
In native iOS, to see overflowed buttons you need to press "right arrow" and it will show you next set of buttons (https://i.imgur.com/D6Ac1KG.png).
@westracer Thanks for the screenshots. We should probably support both of these. I see the "more" button solution in the native Google Keep app on Android, so that should probably be our Android solution, along with the right arrow on iOS.
This will be even more important if we support custom items in the selection menu.
Reacted by Padmal, Matias de Andrea, Hemant Kaushik and Kacper Marcinkiewiczthat looks a lot like #36005
Thanks for finding the duplicate. I'll close that one to focus the discussion here.
When the screen is wide enough to fit the whole menu, this issue doesn't occur. I'm also having this issue where it doesn't happen in emulator when the screen is wide but in my real device where the screen width is smaller. Anyone have a workaround? :)
Personally I had to change the App Button Theme's minWidth as a workaround
Reacted by anton-m-py and Akshay KhataleIs it possible to change the toolbar font size as workaround until this is fixed?
@henriquearthur you can try by modifying the ThemeData of the buttonTheme property of the App main theme
42 remaining items
The best way I found is to wrap the Row(children: items, mainAxisSize: MainAxisSize.min); with SingleChildScrollView. works perfect.
Getting below error:
RenderBox was not laid out: RenderRepaintBoundary#2f05f relayoutBoundary=up4 NEEDS-PAINTwidth: 300.0,
@gokul-a-krishnan - I'm intrigued as to why the arbitrary 300 pixel was chosen?
I choose 300 pixel becoz it will hide some text on "select all" so user think it's scrollable (inspired from Realme devices)@kamleshwebtech The full solution is under review in #49391, it's not yet released.
Reacted by Abdullah AlJemazThis has now been fixed in master with #50935. iOS fix is in the works. I'll link to it when I open a PR.
Reacted by iredia, Abdullah AlJemaz and DenisBogatirov- addeda: annoyanceRepeatedly frustrating issues with non-experimental functionalityRepeatedly frustrating issues with non-experimental functionality
on Mar 25, 2020 Another simple solution I found using the
Wrap Widgetis the following ...
Influtter\packages\flutter\lib\src\material\text_selection.dartreplace line 60 with this:
child: Wrap(direction: Axis.vertical, children: items),
and line 21 with this:
const double _kToolbarHeight = 96.0;
I set the height to96.0because it's the threshold value where the toolbar becomes quadratic and looks like this now:

Have the exact same issue.
The only fix is to disable the toolbar (Assuming you dont need cut/copy/select etc) until this is fixed...
Easily done with enableInteractiveSelection: false,
Has anyone addressed the vertical overflow?
Like in this issue: #58512
The font size should have a minimum and maximum - like the native iOS controls have.
Right now it looks bad with a small iOS font size and it doesn't fit with a large font size (not even through accesibility, a regular larger iOS font size).
@nohli Can you open a new issue to track the vertical size problems? I don't think there's an open issue about that right now.
Reacted by Joachim NohlThis 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.- locked as resolved and limited conversation to collaborators
on Aug 20, 2021


A problem happens in TextFormField Widget when trying to select part of the input text the Selection toolbar show up but not normally it overflow by 3.0 pixels from the right!!!
The funny part that it left more than 3.0 pixels from the left side of screen which its not centered!!
Picture for the problem
https://ibb.co/k9Rk13M
Logs