Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix scrolling sticking to top (#13874)

Stanislav Alekseev2a97aad27398
diff --git a/crates/editor/src/element.rs b/crates/editor/src/element.rs
index 89ddf3cd010..c82d5a4b820 100644
--- a/crates/editor/src/element.rs
+++ b/crates/editor/src/element.rs
@@ -3660,6 +3660,11 @@ impl EditorElement {
if scroll_position != current_scroll_position {
editor.scroll(scroll_position, axis, cx);
cx.stop_propagation();
+ } else if y < 0. {
+ // Due to clamping, we may fail to detect cases of overscroll to the top;
+ // We want the scroll manager to get an update in such cases and detect the change of direction
+ // on the next frame.
+ cx.notify();
}
});
}