diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs index ab29f6c8b290de894b4528c50dd5f20bf5d748bf..b1a3e73d6a6372c99551a409edc630331727523c 100644 --- a/crates/editor/src/element.rs +++ b/crates/editor/src/element.rs @@ -1230,6 +1230,14 @@ impl EditorElement { return; } + // If a drag took place after we started dragging the scrollbar, + // cancel the scrollbar drag. + if cx.has_active_drag() { + self.editor.update(cx, |editor, cx| { + editor.scroll_manager.set_is_dragging_scrollbar(false, cx); + }); + } + let top = bounds.origin.y; let bottom = bounds.lower_left().y; let right = bounds.lower_right().x;