Skip to content

Commit c5e0680

Browse files
committed
Merge pull request #4549
2f3e9ab PasswordDialog: fix lack of focus on window change (selsta)
2 parents e984c28 + 2f3e9ab commit c5e0680

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

components/PasswordDialog.qml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import "." as MoneroComponents
3838
import "effects/" as MoneroEffects
3939
import "../js/Utils.js" as Utils
4040

41-
Item {
41+
FocusScope {
4242
id: root
4343
visible: false
4444

@@ -65,8 +65,6 @@ Item {
6565
capsLockTextLabel.visible = oshelper.isCapsLock();
6666
passwordInput1.reset();
6767
passwordInput2.reset();
68-
if(!appWindow.currentWallet || appWindow.active)
69-
passwordInput1.input.forceActiveFocus();
7068
root.walletName = walletName ? walletName : ""
7169
errorTextLabel.text = errorText ? errorText : "";
7270
leftPanel.enabled = false
@@ -76,6 +74,7 @@ Item {
7674
root.visible = true;
7775
appWindow.hideBalanceForced = true;
7876
appWindow.updateBalance();
77+
Qt.callLater(() => passwordInput1.input.forceActiveFocus())
7978
}
8079

8180
function open(walletName, errorText, okButtonText, okButtonIcon, backgroundSyncOn) {
@@ -214,6 +213,7 @@ Item {
214213
MoneroComponents.LineEdit {
215214
id: passwordInput1
216215
password: true
216+
input.focus: root.visible && (appWindow.active || Qt.application.state === Qt.ApplicationActive)
217217
Layout.topMargin: 6
218218
Layout.fillWidth: true
219219
KeyNavigation.tab: {

0 commit comments

Comments
 (0)