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
This commit is contained in:
parent
3ef1ce3d3e
commit
d4c4b9ad37
1 changed files with 9 additions and 3 deletions
|
|
@ -1291,15 +1291,21 @@ impl InputState {
|
||||||
window: &mut Window,
|
window: &mut Window,
|
||||||
cx: &mut Context<Self>,
|
cx: &mut Context<Self>,
|
||||||
) {
|
) {
|
||||||
cx.stop_propagation();
|
|
||||||
|
|
||||||
let line_height = self
|
let line_height = self
|
||||||
.last_layout
|
.last_layout
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map(|layout| layout.line_height)
|
.map(|layout| layout.line_height)
|
||||||
.unwrap_or(window.line_height());
|
.unwrap_or(window.line_height());
|
||||||
let delta = event.delta.pixel_delta(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;
|
self.diagnostic_popover = None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue