Fix scrolling sticking to top (#13874)

The problem seemingly was that scrolling only started after autoscroll
has finished. I have added a function to forcefully stop it, which I
call when scroll event happens
Release Notes:

- Fixed delay when changing scrolling direction (#13720)

---------

Co-authored-by: Piotr <piotr@zed.dev>
This commit is contained in:
Stanislav Alekseev 2024-07-09 19:44:46 +03:00 committed by GitHub
parent 275dd3fa81
commit 2a97aad273
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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();
}
});
}