mirror of
https://github.com/twonlyapp/twonly-app.git
synced 2026-01-15 09:28:41 +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,12 +90,16 @@ class _TextViewState extends State<TextLayer> {
|
||||||
final bottom = MediaQuery.of(context).viewInsets.bottom +
|
final bottom = MediaQuery.of(context).viewInsets.bottom +
|
||||||
MediaQuery.of(context).viewPadding.bottom;
|
MediaQuery.of(context).viewPadding.bottom;
|
||||||
|
|
||||||
|
// On Android it is possible to close the keyboard without `onEditingComplete` is triggered.
|
||||||
if (maxBottomInset > bottom) {
|
if (maxBottomInset > bottom) {
|
||||||
|
// 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;
|
maxBottomInset = 0;
|
||||||
if (widget.layerData.isEditing) {
|
if (widget.layerData.isEditing) {
|
||||||
widget.layerData.isEditing = false;
|
widget.layerData.isEditing = false;
|
||||||
onEditionComplete();
|
onEditionComplete();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
maxBottomInset = bottom;
|
maxBottomInset = bottom;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue