summaryrefslogtreecommitdiffstats
path: root/mobile-widgets/qml/SsrfTextField.qml
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2020-12-30 16:39:16 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-01-01 11:35:39 -0800
commitd5a7ceb4334aafc4c8cd01c6e8281322cbf9113c (patch)
tree1adde4b7ce71ffd625eed53583b06d3590432ef2 /mobile-widgets/qml/SsrfTextField.qml
parentbb1fb86f2047b81b95f17795c58448c9502c9e9b (diff)
downloadsubsurface-d5a7ceb4334aafc4c8cd01c6e8281322cbf9113c.tar.gz
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 <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qml/SsrfTextField.qml')
-rw-r--r--mobile-widgets/qml/SsrfTextField.qml7
1 files changed, 4 insertions, 3 deletions
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()
}
}