Skip to content

Commit

Permalink
fix(scrollviewer): fix scrollArgs.IsIntermediate on WASm
Browse files Browse the repository at this point in the history
  • Loading branch information
ramezgerges committed Nov 21, 2024
1 parent 23feb21 commit 84c85fe
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,16 @@ internal bool Set(
}

_pendingScrollTo = (horizontalOffset, verticalOffset);
_lastScrollToRequest = (horizontalOffset, verticalOffset);

WindowManagerInterop.ScrollTo(HtmlId, horizontalOffset, verticalOffset, disableAnimation);
try
{
_lastScrollToRequest = (horizontalOffset, verticalOffset);
WindowManagerInterop.ScrollTo(HtmlId, horizontalOffset, verticalOffset, disableAnimation);
}
finally
{
_lastScrollToRequest = (null, null);
}

if (_pendingScrollTo.HasValue)
{
Expand Down Expand Up @@ -356,10 +363,6 @@ private bool OnScroll(object sender, RoutedEventArgs routedEventArgs)
var isIntermediate =
(_lastScrollToRequest.horizontal.HasValue && _lastScrollToRequest.horizontal.Value != horizontalOffset) ||
(_lastScrollToRequest.vertical.HasValue && _lastScrollToRequest.vertical.Value != verticalOffset);
if (!isIntermediate)
{
_lastScrollToRequest = (null, null);
}

if (IsArrangeDirty
&& _pendingScrollTo is { } pending
Expand Down

0 comments on commit 84c85fe

Please sign in to comment.