controlcenter: auto-focus reliably for wireless password input

This commit is contained in:
ATMDA 2025-11-14 18:00:24 -05:00
parent b40b797caf
commit 9a08d6666e

View file

@ -170,12 +170,27 @@ Item {
property string passwordBuffer: "" property string passwordBuffer: ""
Connections {
target: root.session.network
function onShowPasswordDialogChanged(): void {
if (root.session.network.showPasswordDialog) {
// Use callLater to ensure focus happens after dialog is fully rendered
Qt.callLater(() => {
passwordContainer.forceActiveFocus();
passwordContainer.passwordBuffer = "";
});
}
}
}
Connections { Connections {
target: root target: root
function onVisibleChanged(): void { function onVisibleChanged(): void {
if (root.visible) { if (root.visible) {
passwordContainer.forceActiveFocus(); // Use callLater to ensure focus happens after dialog is fully rendered
passwordContainer.passwordBuffer = ""; Qt.callLater(() => {
passwordContainer.forceActiveFocus();
});
} }
} }
} }