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
This commit is contained in:
Finn Evers 2025-03-04 02:46:18 +01:00 committed by GitHub
parent 922aaa0534
commit c03bf1af36
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1509,6 +1509,7 @@ impl Interactivity {
|| self.tracked_focus_handle.is_some()
|| self.hover_style.is_some()
|| self.group_hover_style.is_some()
|| self.hover_listener.is_some()
|| !self.mouse_up_listeners.is_empty()
|| !self.mouse_down_listeners.is_empty()
|| !self.mouse_move_listeners.is_empty()