Skip to content

Commit

Permalink
fix(scrollviewer): fix scrollability logic in PointerWheelScroll
Browse files Browse the repository at this point in the history
  • Loading branch information
ramezgerges committed Aug 30, 2023
1 parent f27d703 commit 7db8ac0
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,22 +200,19 @@ private void PointerWheelScroll(object sender, Input.PointerRoutedEventArgs e)
{
// TODO: Handle zoom https://github.com/unoplatform/uno/issues/4309
}
else if (!canScrollVertically || properties.IsHorizontalMouseWheel || e.KeyModifiers == VirtualKeyModifiers.Shift)
else if (canScrollHorizontally && properties.IsHorizontalMouseWheel)
{
if (canScrollHorizontally)
{
#if __WASM__ // On wasm the scroll might be async (especially with disableAnimation: false), so we need to use the pending value to support high speed multiple wheel events
var horizontalOffset = _pendingScrollTo?.horizontal ?? HorizontalOffset;
var horizontalOffset = _pendingScrollTo?.horizontal ?? HorizontalOffset;
#else
var horizontalOffset = HorizontalOffset;
var horizontalOffset = HorizontalOffset;
#endif

Set(
horizontalOffset: horizontalOffset + GetHorizontalScrollWheelDelta(DesiredSize, delta),
disableAnimation: false);
}
Set(
horizontalOffset: horizontalOffset + GetHorizontalScrollWheelDelta(DesiredSize, delta),
disableAnimation: false);
}
else
else if (canScrollVertically && !properties.IsHorizontalMouseWheel)
{
#if __WASM__ // On wasm the scroll might be async (especially with disableAnimation: false), so we need to use the pending value to support high speed multiple wheel events
var verticalOffset = _pendingScrollTo?.vertical ?? VerticalOffset;
Expand Down

0 comments on commit 7db8ac0

Please sign in to comment.