ui: Fix switch field info tooltip (#35882)

Passing an empty on_click handler so that clicking on the info icon
doesn't actually trigger the switch itself, which happens if you click
anywhere in the general switch field surface area.

Release Notes:

- N/A
This commit is contained in:
Danilo Leal 2025-08-08 15:34:25 -03:00 committed by GitHub
parent 315a92091b
commit 530f5075d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -659,10 +659,12 @@ impl RenderOnce for SwitchField {
.icon_size(IconSize::XSmall) .icon_size(IconSize::XSmall)
.icon_color(Color::Muted) .icon_color(Color::Muted)
.shape(crate::IconButtonShape::Square) .shape(crate::IconButtonShape::Square)
.style(ButtonStyle::Transparent)
.tooltip({ .tooltip({
let tooltip = tooltip_fn.clone(); let tooltip = tooltip_fn.clone();
move |window, cx| tooltip(window, cx) move |window, cx| tooltip(window, cx)
}), })
.on_click(|_, _, _| {}), // Intentional empty on click handler so that clicking on the info tooltip icon doesn't trigger the switch toggle
) )
}); });