@@ -66,6 +66,12 @@ FocusScope {
6666 visible: !root.isPrompt
6767 focus: visible
6868
69+ onVisibleChanged: {
70+ // Qt owns focus, we can't keep our binding active. So make sure
71+ // focus stays in sync manually.
72+ focus = visible;
73+ }
74+
6975 onClicked: {
7076 if (d.enabled) {
7177 d.enabled = false;
@@ -86,12 +92,12 @@ FocusScope {
8692 anchors.fill: parent
8793 visible: root.isPrompt
8894 opacity: fakeLabel.visible ? 0 : 1
95+ focus: visible
8996
90− // Oddly, a simple "focus: visible" does not stick -- the binding
91− // gets lost when switching between buttons and prompts. But this
92− // explicit binding does work.
93− Binding on focus {
94− value: passwordInput.visible
97+ onVisibleChanged: {
98+ // Qt owns focus, we can't keep our binding active. So make sure
99+ // focus stays in sync manually.
100+ focus = visible;
95101 }
96102
97103 validator: RegExpValidator {