mobile/UI: don't show virtual keyboard when starting dive edit

When we start editing a dive the OS will open the virtual keyboard if
any of the input fields have focus (which they might get when we set
their content).
The explicit closing of the keyboard might be overkill, but also doesn't
appear to hurt.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2020-12-30 12:32:57 -08:00
parent d6456d490f
commit 1771c39dd8
2 changed files with 8 additions and 1 deletions

View file

@ -382,7 +382,7 @@ Kirigami.Page {
cylinderIndex4 = modelData.cylinderList.indexOf(usedCyl[4])
rating = modelData.rating
visibility = modelData.viz
detailsEdit.focusReset()
diveDetailsPage.state = "edit"
}

View file

@ -48,6 +48,13 @@ Item {
property int visibility
property var usedCyl: []
function focusReset() {
// set the focus explicitlt (to steal from any other field), then unset
editArea.focus = true
editArea.focus = false
Qt.inputMethod.hide()
}
function clearDetailsEdit() {
detailsEdit.dive_id = 0
detailsEdit.number = 0