diff --git a/crates/egui/src/input_state.rs b/crates/egui/src/input_state.rs index 22851a470b6..e82fd62b75e 100644 --- a/crates/egui/src/input_state.rs +++ b/crates/egui/src/input_state.rs @@ -800,10 +800,8 @@ impl PointerState { } Event::PointerGone => { self.latest_pos = None; - self.pointer_events.push(PointerEvent::Released { - click: None, - button: PointerButton::Primary, - }); + // When dragging a slider and the mouse leaves the viewport, we still want the drag to work, + // so we don't treat this as a `PointerEvent::Released`. // NOTE: we do NOT clear `self.interact_pos` here. It will be cleared next frame. } Event::MouseMoved(delta) => *self.motion.get_or_insert(Vec2::ZERO) += *delta,