File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
modules/gui/qt/network/qml Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ FocusScope {
3333
3434 // Properties
3535
36+ property bool _initialized: false
37+ property bool _resetFocusPendingAfterInitialization: false
38+
3639 property int leftPadding: 0
3740 property int rightPadding: 0
3841
@@ -69,8 +72,24 @@ FocusScope {
6972
7073 focus: true
7174
72- onActiveFocusChanged: resetFocus ()
7375
76+ Component .onCompleted : {
77+ _initialized = true
78+ if (_resetFocusPendingAfterInitialization) {
79+ resetFocus ()
80+
81+ _resetFocusPendingAfterInitialization = false
82+ }
83+ }
84+
85+ onActiveFocusChanged: {
86+ if (! _initialized) {
87+ _resetFocusPendingAfterInitialization = true
88+ return
89+ }
90+
91+ resetFocus ()
92+ }
7493
7594 function setCurrentItemFocus (reason ) {
7695 if (foldersSection .visible )
You can’t perform that action at this time.
0 commit comments