Fix keyboard focus during setup while tip is up

This commit is contained in:
Zach Fox 2017-09-28 13:12:42 -07:00
parent 751dca0761
commit 3742ccbdd3
2 changed files with 13 additions and 4 deletions

View file

@ -26,6 +26,7 @@ Item {
id: root;
property bool isChangingPassphrase: false;
property bool isShowingTip: false;
property bool shouldImmediatelyFocus: true;
// This object is always used in a popup.
// This MouseArea is used to prevent a user from being
@ -53,10 +54,8 @@ Item {
// TODO: Fix this unlikely bug
onVisibleChanged: {
if (visible) {
if (root.isChangingPassphrase) {
currentPassphraseField.focus = true;
} else {
passphraseField.focus = true;
if (root.shouldImmediatelyFocus) {
focusFirstTextField();
}
sendMessageToLightbox({method: 'disableHmdPreview'});
} else {
@ -320,5 +319,13 @@ Item {
setErrorText("");
}
function focusFirstTextField() {
if (root.isChangingPassphrase) {
currentPassphraseField.focus = true;
} else {
passphraseField.focus = true;
}
}
signal sendMessageToLightbox(var msg);
}

View file

@ -422,6 +422,7 @@ Item {
onClicked: {
root.hasShownSecurityImageTip = true;
securityImageTip.visible = false;
passphraseSelection.focusFirstTextField();
}
}
}
@ -466,6 +467,7 @@ Item {
PassphraseSelection {
id: passphraseSelection;
shouldImmediatelyFocus: root.hasShownSecurityImageTip;
isShowingTip: securityImageTip.visible;
anchors.top: passphraseTitleHelper.bottom;
anchors.topMargin: 30;