diff --git a/app/qml/components/private/MMBaseSingleLineInput.qml b/app/qml/components/private/MMBaseSingleLineInput.qml index b1f818e67..db7cccd3c 100644 --- a/app/qml/components/private/MMBaseSingleLineInput.qml +++ b/app/qml/components/private/MMBaseSingleLineInput.qml @@ -169,6 +169,8 @@ MMBaseInput { onTextEdited: root.textEdited( text ) + onPreeditTextChanged: if( __androidUtils.isAndroid ) Qt.inputMethod.commit() // to avoid Android's unconfirmed text + onReleased: { if ( root.editState !== "readOnly" ) { root.textClicked() diff --git a/app/qml/form/editors/MMFormTextMultilineEditor.qml b/app/qml/form/editors/MMFormTextMultilineEditor.qml index a907bc27e..4dd2cfafc 100644 --- a/app/qml/form/editors/MMFormTextMultilineEditor.qml +++ b/app/qml/form/editors/MMFormTextMultilineEditor.qml @@ -128,6 +128,7 @@ MMPrivateComponents.MMBaseInput { } onTextChanged: root.editorValueChanged( textArea.text, textArea.text === "" ) + onPreeditTextChanged: if( __androidUtils.isAndroid ) Qt.inputMethod.commit() // to avoid Android's unconfirmed text } FontMetrics { diff --git a/app/qml/inputs/MMSearchInput.qml b/app/qml/inputs/MMSearchInput.qml index ca3842456..2fdfb0cc1 100644 --- a/app/qml/inputs/MMSearchInput.qml +++ b/app/qml/inputs/MMSearchInput.qml @@ -60,7 +60,8 @@ MMPrivateComponents.MMBaseSingleLineInput { } else { - root.searchText = root.text + // trim the last whitespace from the user's input + root.searchText = root.text.replace( /\s+$/, "" ) } } @@ -70,7 +71,11 @@ MMPrivateComponents.MMBaseSingleLineInput { interval: root.emitInterval running: false - onTriggered: root.searchText = root.text + onTriggered: { + // when using predictive text suggestions, a whitespace is sometimes added after the word + // trim the last whitespace from the user's input + root.searchText = root.text.replace( /\s+$/, "" ) + } } /**