From 90b8acfb34feaa6604272a0d5064927b715fc6b5 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Wed, 29 Nov 2023 23:55:14 -0700 Subject: [PATCH] Allow toggling subchannel visiblity without joining channel --- crates/ui2/src/components/button/button_like.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/ui2/src/components/button/button_like.rs b/crates/ui2/src/components/button/button_like.rs index 4dd31e26c7..c99a226ee0 100644 --- a/crates/ui2/src/components/button/button_like.rs +++ b/crates/ui2/src/components/button/button_like.rs @@ -262,7 +262,12 @@ impl RenderOnce for ButtonLike { .active(|active| active.bg(self.style.active(cx).background)) .when_some( self.on_click.filter(|_| !self.disabled), - |this, on_click| this.on_click(move |event, cx| (on_click)(event, cx)), + |this, on_click| { + this.on_click(move |event, cx| { + cx.stop_propagation(); + (on_click)(event, cx) + }) + }, ) .when_some(self.tooltip, |this, tooltip| { this.tooltip(move |cx| tooltip(cx))