Prevent scrolling editor and resizing panels at the same time (#3887)

Release Notes:

- Fixed a bug that would cause Zed to never stop resizing panels when
the drag handle overlapped with an editor scrollbar.
This commit is contained in:
Antonio Scandurra 2024-01-04 18:06:22 +01:00 committed by GitHub
commit 8d07246f7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;