diff --git a/crates/gpui/src/elements/div.rs b/crates/gpui/src/elements/div.rs index 41ed75beefebd8b5501bc05a302ca4ad4f585bf2..24ad5e77780398f5a714caf62e49a6a2952cca77 100644 --- a/crates/gpui/src/elements/div.rs +++ b/crates/gpui/src/elements/div.rs @@ -3644,8 +3644,15 @@ mod tests { let active_tooltip: Rc>> = Rc::new(RefCell::new(None)); let weak_active_tooltip = Rc::downgrade(&active_tooltip); + + let mut interactivity = Interactivity::default(); + interactivity.tooltip(|_, cx| cx.new(|_| TestTooltipView).into()); + let tooltip_builder = interactivity.tooltip_builder.take().unwrap(); + let tooltip_is_hoverable = tooltip_builder.hoverable; let build_tooltip: Rc Option<(AnyView, bool)>> = - Rc::new(|_, cx| Some((cx.new(|_| TestTooltipView).into(), false))); + Rc::new(move |window: &mut Window, cx: &mut App| { + Some(((tooltip_builder.build)(window, cx), tooltip_is_hoverable)) + }); let check_is_hovered: Rc bool> = Rc::new(|_: &Window| true); let check_is_hovered_during_prepaint: Rc bool> = Rc::new(|_: &Window| true);