File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Microsoft.Toolkit.Uwp.UI.Animations/Behaviors Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 1111using Windows . UI . Xaml . Controls ;
1212using Windows . UI . Xaml . Hosting ;
1313using Windows . UI . Xaml . Input ;
14+ using Windows . UI . Xaml . Media ;
1415
1516namespace Microsoft . Toolkit . Uwp . UI . Animations . Behaviors
1617{
@@ -238,7 +239,9 @@ private void ScrollViewer_GotFocus(object sender, RoutedEventArgs e)
238239 focusedElement = FocusManager . GetFocusedElement ( ) ;
239240 }
240241
241- if ( focusedElement is UIElement element )
242+ // To prevent Popups (Flyouts...) from triggering the autoscroll, we check if the focused element has a valid parent.
243+ // Popups have no parents, whereas a normal Item would have the ListView as a parent.
244+ if ( focusedElement is UIElement element && VisualTreeHelper . GetParent ( element ) != null )
242245 {
243246 FrameworkElement header = ( FrameworkElement ) HeaderElement ;
244247
You can’t perform that action at this time.
0 commit comments