From e674bf4b8d40cdac860e8248a137aba0350ebd66 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 9 May 2026 09:50:10 +0200 Subject: [PATCH] Stop wheel events bubbling out of the flags filter popup PointerWheelChanged kept bubbling past the popup's ScrollViewer to the underlying DataGrid, so spinning the wheel inside the dropdown also scrolled the grid behind. Mark the event handled at the popup's root Border with handledEventsToo so the inner ScrollViewer keeps its scroll behaviour but the event stops at the popup boundary. Assisted-by: Claude:claude-opus-4-7:Claude Code --- ILSpy/Metadata/MetadataColumnBuilder.cs | 36 +++++++++++++++---------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/ILSpy/Metadata/MetadataColumnBuilder.cs b/ILSpy/Metadata/MetadataColumnBuilder.cs index 403f5c236..ee55e5179 100644 --- a/ILSpy/Metadata/MetadataColumnBuilder.cs +++ b/ILSpy/Metadata/MetadataColumnBuilder.cs @@ -174,24 +174,32 @@ namespace ILSpy.Metadata MinHeight = 0, VerticalAlignment = VerticalAlignment.Stretch, }; + var popupRoot = new Border { + BorderBrush = Brushes.Gray, + BorderThickness = new Thickness(1), + Background = Brushes.White, + // Force the arrow cursor on the popup surface — without this, the + // EW-resize cursor set on the DataGrid column header's drag-grip can + // leak into the popup if the pointer enters from there before + // Avalonia recomputes the cursor for the new hit-test target. + Cursor = new global::Avalonia.Input.Cursor(global::Avalonia.Input.StandardCursorType.Arrow), + Child = new ScrollViewer { + MaxHeight = 400, + Content = popupContent, + }, + }; + // Stop wheel events from bubbling out of the popup. Without this, scrolling + // inside the dropdown also scrolls the underlying DataGrid because the + // PointerWheelChanged event keeps bubbling up the routed-event tree once the + // inner ScrollViewer has consumed (or ignored) it. + popupRoot.AddHandler(global::Avalonia.Input.InputElement.PointerWheelChangedEvent, + (_, e) => e.Handled = true, + handledEventsToo: true); var popup = new Popup { PlacementTarget = openButton, Placement = PlacementMode.BottomEdgeAlignedLeft, IsLightDismissEnabled = true, - Child = new Border { - BorderBrush = Brushes.Gray, - BorderThickness = new Thickness(1), - Background = Brushes.White, - // Force the arrow cursor on the popup surface — without this, the - // EW-resize cursor set on the DataGrid column header's drag-grip can - // leak into the popup if the pointer enters from there before - // Avalonia recomputes the cursor for the new hit-test target. - Cursor = new global::Avalonia.Input.Cursor(global::Avalonia.Input.StandardCursorType.Arrow), - Child = new ScrollViewer { - MaxHeight = 400, - Content = popupContent, - }, - }, + Child = popupRoot, }; openButton.Click += (_, _) => popup.IsOpen = true; var row = new DockPanel { LastChildFill = true, Margin = new Thickness(0, 2, 0, 0) };