# gpui: Unify \`track_scroll\` method to receive a reference type \(\#43518\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 1a23115773ac3466444256992f661ee31cbaace2

Requested commit: 1a23115773ac3466444256992f661ee31cbaace2

Commit: 1a23115773ac3466444256992f661ee31cbaace2

Tree: ac02b5dd6a7575394502ff3ede9510a651e32ae1

Author: Jason Lee

Committer: GitHub

## Message

````
gpui: Unify `track_scroll` method to receive a reference type (#43518)

Release Notes:

- N/A

This PR to change the `track_scroll` method to receive a reference type
like the
[Div#track_scroll](https://docs.rs/gpui/latest/gpui/trait.StatefulInteractiveElement.html#method.track_scroll),
[Div#track_focus](https://docs.rs/gpui/latest/gpui/trait.InteractiveElement.html#method.track_focus).


```diff
- .track_scroll(self.scroll_handle.clone())
+ .track_scroll(&self.scroll_handle)

- .vertical_scrollbar_for(self.scroll_handle.clone(), window, cx)
+ .vertical_scrollbar_for(&self.scroll_handle, window, cx)
```


https://github.com/zed-industries/zed/blob/56a2f9cfcf0c6a3c38f596b58002953763cd890f/crates/gpui/src/elements/div.rs#L1088-L1093


https://github.com/zed-industries/zed/blob/56a2f9cfcf0c6a3c38f596b58002953763cd890f/crates/gpui/src/elements/div.rs#L613-L620
````

## Parents

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

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