# Auto-scroll hover popup while selecting text \(\#57518\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 6049ceaecf397765104080545ab41d578a6109f9

Requested commit: 6049ceaecf397765104080545ab41d578a6109f9

Commit: 6049ceaecf397765104080545ab41d578a6109f9

Tree: d85a14d6647e4cadb5f1b7df897374fff5e6573e

Author: Daniel Martín

Committer: GitHub

## Message

```
Auto-scroll hover popup while selecting text (#57518)

Selecting text inside the hover documentation or git popups did not
scroll the popup when the drag passed the visible area, so any text
below the area could not be selected with the mouse.

The popup's container already had a `ScrollHandle` wired to its
scrollbar and wheel scrolling, but the inner `MarkdownElement` was
constructed without one. That left it in the default
`AutoscrollBehavior::Propagate` mode, which routes drag-autoscroll
requests to the editor-wide autoscroll listener, which is a listener
that does not exist inside a floating popover, so the requests were
silently dropped.

Passing the popup's existing `ScrollHandle` into the `MarkdownElement`
switches it to `AutoscrollBehavior::Controlled`, which scrolls the
popup's own container directly during a drag. The markdown preview view
already uses this same pattern.

Release Notes:

- Fixed hover documentation and git popups not scrolling while selecting
text with the mouse

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
```

## Parents

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

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