# gpui: Ensure hitbox is inserted when element has hover listener \(\#25981\) · gitcafe/zed

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

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

Visibility: public

Requested revision: c03bf1af36740d844f68904cc9a9fe11caf7cc56

Requested commit: c03bf1af36740d844f68904cc9a9fe11caf7cc56

Commit: c03bf1af36740d844f68904cc9a9fe11caf7cc56

Tree: f6db0f583527ebd23b612ce0db77a34ddc8c6d97

Author: Finn Evers

Committer: GitHub

## Message

```
gpui: Ensure hitbox is inserted when element has hover listener (#25981)

Currently, when an element has only a hover listener, the attached
listener will never trigger, because within the check for whether a
hitbox has to be inserted for the given element, this case it not
considered.
That leads to the behaviour as described in
https://github.com/zed-industries/zed/pull/25602#discussion_r1970720972,
where another event listener has to be attached to the element in order
for the hover listener to work.

This PR fixes the issue by ensuring that a hitbox is also inserted when
only a hover listener is attached to the element.

Release Notes:

- N/A
```

## Parents

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

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