fix keyboard switch to emoji
Some checks failed
Flutter analyze & test / flutter_analyze_and_test (push) Has been cancelled

This commit is contained in:
otsmr 2025-11-23 15:13:48 +01:00
parent 7268e990bc
commit 819c8201d2

View file

@ -90,12 +90,16 @@ 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) {
// 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;
}