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()
110110 }
111111
112112 var focusedControlIndex = - 1 ;
113- var listViewBaseControls = 0 ;
113+ var hasListViewBaseControl = false ;
114114 for ( var i = 0 ; i < Targets . Count ; i ++ )
115115 {
116116 var control = Targets [ i ] . Control ;
@@ -132,7 +132,7 @@ private void ApplyFocus()
132132 // The list may not have any item yet, we wait until the first item is rendered.
133133 listViewBase . ContainerContentChanging -= OnContainerContentChanging ;
134134 listViewBase . ContainerContentChanging += OnContainerContentChanging ;
135- listViewBaseControls ++ ;
135+ hasListViewBaseControl = true ;
136136 }
137137 }
138138 else
@@ -142,7 +142,7 @@ private void ApplyFocus()
142142 }
143143 }
144144
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 ) ) )
146146 {
147147 // The first control has received the focus or all the control are loaded and none can take the focus: we stop.
148148 Stop ( ) ;
You can’t perform that action at this time.
0 commit comments