From d4c4b9ad3773b0a817ec5b8d1e9d7aa6a006797b Mon Sep 17 00:00:00 2001 From: chulingera2025 Date: Thu, 13 Nov 2025 10:19:52 +0800 Subject: [PATCH] input: Avoid blocking vertical scroll events in single-line mode (#1562) (#1572) Fixes #1562 ## Problem Single-line input fields were blocking all scroll wheel events, preventing parent containers from handling vertical page scrolling. ## Solution - Check if input is in single-line mode and scroll is purely vertical - Allow vertical scroll events to propagate in single-line mode - Only stop propagation when scroll offset actually changes ## Behavior - Single-line inputs: vertical scroll passes through to parent - Multi-line inputs: all scroll behavior unchanged - Horizontal scrolling still works in both modes --- crates/ui/src/input/state.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/ui/src/input/state.rs b/crates/ui/src/input/state.rs index 6ac8dc1d..38487eae 100644 --- a/crates/ui/src/input/state.rs +++ b/crates/ui/src/input/state.rs @@ -1291,15 +1291,21 @@ impl InputState { window: &mut Window, cx: &mut Context, ) { - cx.stop_propagation(); - let line_height = self .last_layout .as_ref() .map(|layout| layout.line_height) .unwrap_or(window.line_height()); let delta = event.delta.pixel_delta(line_height); - self.update_scroll_offset(Some(self.scroll_handle.offset() + delta), cx); + + let old_offset = self.scroll_handle.offset(); + self.update_scroll_offset(Some(old_offset + delta), cx); + + // Only stop propagation if the offset actually changed + if self.scroll_handle.offset() != old_offset { + cx.stop_propagation(); + } + self.diagnostic_popover = None; }