Skip to content

Commit 08f3fd2

Browse files
authored
Fix scroll area not consuming scroll events (#7904)
This fixes scrolling in a nested scroll area also scrolling the outer scroll area https://github.com/user-attachments/assets/ade40b1e-c974-4806-8045-881bea590d4a
1 parent 64a96ef commit 08f3fd2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

crates/egui/src/containers/scroll_area.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,10 +1198,9 @@ impl Prepared {
11981198
// Clear scroll delta so no parent scroll will use it:
11991199
ui.input_mut(|input| {
12001200
if always_scroll_enabled_direction {
1201-
input.smooth_scroll_delta()[0] = 0.0;
1202-
input.smooth_scroll_delta()[1] = 0.0;
1201+
input.smooth_scroll_delta = Vec2::ZERO;
12031202
} else {
1204-
input.smooth_scroll_delta()[d] = 0.0;
1203+
input.smooth_scroll_delta[d] = 0.0;
12051204
}
12061205
});
12071206

0 commit comments

Comments
 (0)