File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Microsoft.Toolkit.Uwp.UI.Behaviors/Focus Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -110,7 +110,7 @@ private void ApplyFocus()
110
110
}
111
111
112
112
var focusedControlIndex = - 1 ;
113
- var listViewBaseControls = 0 ;
113
+ var hasListViewBaseControl = false ;
114
114
for ( var i = 0 ; i < Targets . Count ; i ++ )
115
115
{
116
116
var control = Targets [ i ] . Control ;
@@ -132,7 +132,7 @@ private void ApplyFocus()
132
132
// The list may not have any item yet, we wait until the first item is rendered.
133
133
listViewBase . ContainerContentChanging -= OnContainerContentChanging ;
134
134
listViewBase . ContainerContentChanging += OnContainerContentChanging ;
135
- listViewBaseControls ++ ;
135
+ hasListViewBaseControl = true ;
136
136
}
137
137
}
138
138
else
@@ -142,7 +142,7 @@ private void ApplyFocus()
142
142
}
143
143
}
144
144
145
- if ( focusedControlIndex == 0 || ( listViewBaseControls == 0 && Targets . All ( t => t . Control ? . IsLoaded == true ) ) )
145
+ if ( focusedControlIndex == 0 || ( ! hasListViewBaseControl && Targets . All ( t => t . Control ? . IsLoaded == true ) ) )
146
146
{
147
147
// The first control has received the focus or all the control are loaded and none can take the focus: we stop.
148
148
Stop ( ) ;
You can’t perform that action at this time.
0 commit comments