mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 07:48:40 +00:00
fix keyboard switch to emoji
Some checks failed
Flutter analyze & test / flutter_analyze_and_test (push) Has been cancelled
Some checks failed
Flutter analyze & test / flutter_analyze_and_test (push) Has been cancelled
This commit is contained in:
parent
7268e990bc
commit
819c8201d2
1 changed files with 8 additions and 4 deletions
|
|
@ -90,11 +90,15 @@ class _TextViewState extends State<TextLayer> {
|
|||
final bottom = MediaQuery.of(context).viewInsets.bottom +
|
||||
MediaQuery.of(context).viewPadding.bottom;
|
||||
|
||||
// On Android it is possible to close the keyboard without `onEditingComplete` is triggered.
|
||||
if (maxBottomInset > bottom) {
|
||||
maxBottomInset = 0;
|
||||
if (widget.layerData.isEditing) {
|
||||
widget.layerData.isEditing = false;
|
||||
onEditionComplete();
|
||||
// prevent that the text element will be disappearing in case the keyboard just switches for example to the emoji page
|
||||
if (bottom < 20) {
|
||||
maxBottomInset = 0;
|
||||
if (widget.layerData.isEditing) {
|
||||
widget.layerData.isEditing = false;
|
||||
onEditionComplete();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
maxBottomInset = bottom;
|
||||
|
|
|
|||
Loading…
Reference in a new issue