From b101d336d041c980b75b79d9148062447e4c04f0 Mon Sep 17 00:00:00 2001 From: gramps Date: Tue, 18 Aug 2026 07:00:51 -0700 Subject: [PATCH] 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. --- MainWindow.xaml | 2 +- MainWindow.xaml.cs | 2 +- TASKS.md | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/MainWindow.xaml b/MainWindow.xaml index ce0d36f..5bff6cd 100644 --- a/MainWindow.xaml +++ b/MainWindow.xaml @@ -366,7 +366,7 @@ Visibility="{Binding SelectedElement, Converter={StaticResource NotNullToVis}}"> - diff --git a/MainWindow.xaml.cs b/MainWindow.xaml.cs index ea6848c..b118340 100644 --- a/MainWindow.xaml.cs +++ b/MainWindow.xaml.cs @@ -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; } diff --git a/TASKS.md b/TASKS.md index dccb2c3..8c9dbc8 100644 --- a/TASKS.md +++ b/TASKS.md @@ -825,6 +825,7 @@ No changes to `MusicPlayer`, the 0.20 cap, the ducker, or the meter zones. Build 8. ✅ Webcam border config — color hex input + color swatch picker, border thickness 0–10 slider 9. ✅ Countdown source — `SourceType.Countdown`, pick list (Starting/BRB scenes only), timer minutes 1–60 default 15 10. ✅ Web source — `SourceType.WebSource`, pick list (all scenes), URI text input +11. ✅ Elements scrollbar deselect fix — clicking the Elements panel scrollbar no longer deselects the selected element (scrollbar lives inside the ScrollViewer, not the StackPanel; guard now checks `ElementsScrollViewer` instead of `ElementsPanel`) ---