From d5a7ceb4334aafc4c8cd01c6e8281322cbf9113c Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Wed, 30 Dec 2020 16:39:16 -0800 Subject: mobile/UI: trigger position check on focus Doing this check every time we get a 'pressed' signal for the input field seems excessive. We really only need to check when the input field gets focus - that's when the OS virtual keyboard might open and hide the field the user wants to edit. Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/SsrfTextField.qml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mobile-widgets/qml') diff --git a/mobile-widgets/qml/SsrfTextField.qml b/mobile-widgets/qml/SsrfTextField.qml index e33cb3ea2..84b7695b7 100644 --- a/mobile-widgets/qml/SsrfTextField.qml +++ b/mobile-widgets/qml/SsrfTextField.qml @@ -20,9 +20,10 @@ Controls.TextField { firstTime = true } - // that's when a user taps on the field to start entering text - onPressed: { - if (flickable !== undefined) { + // once a text input has focus, make sure it is visible + // we do this via a timer to give the OS time to show a virtual keyboard + onFocusChanged: { + if (focus && flickable !== undefined) { waitForKeyboard.start() } } -- cgit v1.2.3-70-g09d2