Fix: Elements scrollbar click no longer deselects the selected element

The scrollbar lives inside the ScrollViewer, not the StackPanel
(ElementsPanel). Window_PreviewMouseLeftButtonDown was checking
IsDescendantOf against ElementsPanel, so scrollbar clicks fell through
and nulled SelectedElement. Now checks ElementsScrollViewer instead.

1a of 7-issue polish batch. 207 tests, 0 warnings.
This commit is contained in:
2026-08-18 07:00:51 -07:00
parent c7d4b3b6d9
commit b101d336d0
3 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -209,7 +209,7 @@ public partial class MainWindow : Window
if (e.OriginalSource is not DependencyObject original) return;
if (IsDescendantOf(original, PreviewGrid)) return;
if (IsDescendantOf(original, SourceList)) return;
if (IsDescendantOf(original, ElementsPanel)) return;
if (IsDescendantOf(original, ElementsScrollViewer)) return;
_viewModel.SelectedElement = null;
}