From 5ee3a9f567e90bca5f8f7bc56f64dcbd397e5731 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Wed, 1 Mar 2017 13:14:51 -0800 Subject: [PATCH] Drop focus after virtual keyboard is done Some android versions leave a focus arrow indicator turd in the control. This gets rid of it. --- src/FactSystem/FactControls/FactTextField.qml | 4 ++++ src/QmlControls/QGCTextField.qml | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/src/FactSystem/FactControls/FactTextField.qml b/src/FactSystem/FactControls/FactTextField.qml index 3dd02aa..58a7093 100644 --- a/src/FactSystem/FactControls/FactTextField.qml +++ b/src/FactSystem/FactControls/FactTextField.qml @@ -26,6 +26,10 @@ QGCTextField { Qt.ImhFormattedNumbersOnly // Forces use of virtual numeric keyboard onEditingFinished: { + if (ScreenTools.isMobile) { + // Toss focus on mobile after Done on virtual keyboard. Prevent strange interactions. + focus = false + } if (typeof qgcView !== 'undefined' && qgcView) { var errorString = fact.validate(text, false /* convertOnly */) if (errorString == "") { diff --git a/src/QmlControls/QGCTextField.qml b/src/QmlControls/QGCTextField.qml index 699a82c..8b5497e 100644 --- a/src/QmlControls/QGCTextField.qml +++ b/src/QmlControls/QGCTextField.qml @@ -29,6 +29,13 @@ TextField { implicitHeight: ScreenTools.implicitTextFieldHeight + onEditingFinished: { + if (ScreenTools.isMobile) { + // Toss focus on mobile after Done on virtual keyboard. Prevent strange interactions. + focus = false + } + } + QGCLabel { id: unitsLabelWidthGenerator text: unitsLabel