From 61b3895f0c7a86e7b275621e70531891a9291901 Mon Sep 17 00:00:00 2001 From: Apflkuacha Date: Thu, 14 Mar 2024 00:03:09 +0100 Subject: [PATCH] Fix Scrolling on Firefox This fixes the issue: https://github.com/belucha/oxyplot.blazor/issues/18 Add the event "onwheel", infos could be found here: https://www.w3.org/TR/DOM-Level-3-Events/#events-wheelevents --- OxyPlot.Blazor/BlazorPlotView.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OxyPlot.Blazor/BlazorPlotView.cs b/OxyPlot.Blazor/BlazorPlotView.cs index 6fae15f..bfd17cc 100644 --- a/OxyPlot.Blazor/BlazorPlotView.cs +++ b/OxyPlot.Blazor/BlazorPlotView.cs @@ -271,6 +271,7 @@ protected override void BuildRenderTree(RenderTreeBuilder builder) AddEventCallback(builder, 10, "onmousemove", e => ActualController.HandleMouseMove(this, TranslateMouseEventArgs(e))); AddEventCallback(builder, 11, "onmouseenter", e => ActualController.HandleMouseEnter(this, TranslateMouseEventArgs(e))); AddEventCallback(builder, 12, "onmouseleave", e => ActualController.HandleMouseEnter(this, TranslateMouseEventArgs(e))); + AddEventCallback(builder, 13, "onwheel", e => ActualController.HandleMouseWheel(this, TranslateWheelEventArgs(e)), preventDefault: false); AddEventCallback(builder, 13, "onmousewheel", e => ActualController.HandleMouseWheel(this, TranslateWheelEventArgs(e)), preventDefault: false); AddEventCallback(builder, 14, "onkeydown", HandleKeyDownEvent, preventDefault: _preventKey, addAlways: true); } @@ -541,4 +542,4 @@ public ValueTask DisposeAsync() } return _resizeObserver?.DisposeAsync() ?? ValueTask.CompletedTask; } -} \ No newline at end of file +}