# editor: Fix sticky header drag cancels autoscroll \(\#53592\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/f16101a758cdbbc0e2851a40d9b8bb70e60826b9)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: f16101a758cdbbc0e2851a40d9b8bb70e60826b9

Requested commit: f16101a758cdbbc0e2851a40d9b8bb70e60826b9

Commit: f16101a758cdbbc0e2851a40d9b8bb70e60826b9

Tree: d1df31083c87ca6f9b348331be91044af310a149

Author: Tim Vermeulen

Committer: GitHub

## Message

```
editor: Fix sticky header drag cancels autoscroll (#53592)

In #52636 I seem to have introduced this bug, where mouse-down on a
sticky header followed by an immediate mouse movements sometimes dropped
the pending autoscroll request (to jump to the sticky header line):
https://github.com/zed-industries/zed/blob/1fcf9749a6ed384ae346ddf2049ae76e0cc430a9/crates/editor/src/scroll.rs#L453

Fixed by exiting early from `mouse_dragged` when
`editor.has_autoscroll_request()`.

What sometimes happened before this fix:


https://github.com/user-attachments/assets/b6dd6650-b5f0-4ea1-ae70-9c4cf69e31a0

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed bug where clicking on a sticky header would sometimes not jump
to that line in the editor
```

## Parents

- [c28cf645f9b3649611afc5d6df58791cf04d62a9](https://git.cafe/gitcafe/zed/commit/c28cf645f9b3649611afc5d6df58791cf04d62a9?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/f16101a758cdbbc0e2851a40d9b8bb70e60826b9?format=markdown)
