Skip to content

Commit

Permalink
feat(NavigationView): Include Fix issue with cancelled touch pointers…
Browse files Browse the repository at this point in the history
… not resetting state correctly

microsoft/microsoft-ui-xaml#6875
  • Loading branch information
MartinZikmund committed Sep 18, 2023
1 parent b58f36f commit 38d7ae1
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.
// MUX reference NavigationViewItem.cpp, commit 608ec43
// MUX reference NavigationViewItem.cpp, commit 18a981d

#if __ANDROID__
// For performance considerations, we prefer to delay pressed and over state in order to avoid
Expand Down Expand Up @@ -1181,7 +1181,8 @@ private void ProcessPointerCanceled(PointerRoutedEventArgs args)
// What this flag tracks is complicated because of the NavigationView sub items and the m_capturedPointers that are being tracked..
// We do this check because PointerCaptureLost can sometimes take the place of PointerReleased events.
// In these cases we need to test if the pointer is over the item to maintain the proper state.
if (IsOutOfControlBounds(args.GetCurrentPoint(this).Position))
// In the case of touch input, we want to cancel anyway since there will be no pointer exited due to the pointer being cancelled.
if (IsOutOfControlBounds(args.GetCurrentPoint(this).Position) || args.Pointer.PointerDeviceType == PointerDeviceType.Touch)
#endif
{
m_isPointerOver = false;
Expand Down

0 comments on commit 38d7ae1

Please sign in to comment.