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 11
11
using Windows . UI . Xaml . Controls ;
12
12
using Windows . UI . Xaml . Hosting ;
13
13
using Windows . UI . Xaml . Input ;
14
+ using Windows . UI . Xaml . Media ;
14
15
15
16
namespace Microsoft . Toolkit . Uwp . UI . Animations . Behaviors
16
17
{
@@ -238,7 +239,9 @@ private void ScrollViewer_GotFocus(object sender, RoutedEventArgs e)
238
239
focusedElement = FocusManager . GetFocusedElement ( ) ;
239
240
}
240
241
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 )
242
245
{
243
246
FrameworkElement header = ( FrameworkElement ) HeaderElement ;
244
247
You can’t perform that action at this time.
0 commit comments