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: ""
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 {
target: root
function onVisibleChanged(): void {
if (root.visible) {
passwordContainer.forceActiveFocus();
passwordContainer.passwordBuffer = "";
// Use callLater to ensure focus happens after dialog is fully rendered
Qt.callLater(() => {
passwordContainer.forceActiveFocus();
});
}
}
}