Skip to content

Commit

Permalink
🐛 fix(PullRefresh): should not preventDefault on touch move (#1950)
Browse files Browse the repository at this point in the history
  • Loading branch information
capdiem committed Jun 3, 2024
1 parent 49c138f commit 5e3ed4e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Masa.Blazor/Components/PullRefresh/MPullRefresh.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
Passive = false
}, new EventListenerExtras()
{
PreventDefault = true,
PreventDefault = false,
Throttle = 16
});
}
Expand Down Expand Up @@ -146,6 +146,11 @@ private async Task OnTouchMove(TouchEventArgs args)

if (_reachTop && _toucher.DeltaY >= 0 && _toucher.IsVertical)
{
// HACK: In JavaScript, should dynamically set the `preventDefault()` here,
// but in Blazor, it's difficult to do that. so we set it to false in `AddHtmlElementEventListener`.
// If it's necessary, should refactor this part.
// args.PreventDefault();

await _throttleTask.RunAsync(async () =>
{
if (IsTouchable)
Expand Down

0 comments on commit 5e3ed4e

Please sign in to comment.