From c03bf1af36740d844f68904cc9a9fe11caf7cc56 Mon Sep 17 00:00:00 2001 From: Finn Evers Date: Tue, 4 Mar 2025 02:46:18 +0100 Subject: [PATCH] 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 --- crates/gpui/src/elements/div.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/gpui/src/elements/div.rs b/crates/gpui/src/elements/div.rs index ab0b278182..b0ae2c2474 100644 --- a/crates/gpui/src/elements/div.rs +++ b/crates/gpui/src/elements/div.rs @@ -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()