Skip to content

Commit

Permalink
Fixes CommunityToolkit#3170 - A horizontal scroll happens if the mous…
Browse files Browse the repository at this point in the history
…e has a horizontal wheel OR if the horizontal scrollbar is not disabled AND the vertical scrollbar IS disabled
  • Loading branch information
skendrot committed Mar 18, 2020
1 parent ef65272 commit 498080e
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3712,7 +3712,10 @@ protected override void OnPointerWheelChanged(PointerRoutedEventArgs e)
if (!e.Handled)
{
PointerPoint pointerPoint = e.GetCurrentPoint(this);
bool isForHorizontalScroll = pointerPoint.Properties.IsHorizontalMouseWheel;

// A horizontal scroll happens if the mouse has a horizontal wheel OR if the horizontal scrollbar is not disabled AND the vertical scrollbar IS disabled
bool isForHorizontalScroll = pointerPoint.Properties.IsHorizontalMouseWheel |
(this.HorizontalScrollBarVisibility != ScrollBarVisibility.Disabled && this.VerticalScrollBarVisibility == ScrollBarVisibility.Disabled);

if ((isForHorizontalScroll && this.HorizontalScrollBarVisibility == ScrollBarVisibility.Disabled) ||
(!isForHorizontalScroll && this.VerticalScrollBarVisibility == ScrollBarVisibility.Disabled))
Expand Down

0 comments on commit 498080e

Please sign in to comment.