From ad87c545c779e8743ed86f3def3540d7fbcdb198 Mon Sep 17 00:00:00 2001 From: Richard Feldman Date: Thu, 1 May 2025 16:28:54 -0400 Subject: [PATCH] Make context pills clickable while editing (#29740) Release Notes: - Fixed a bug where clicking context pills switched into the "editing message" state instead of clicking the pill. Co-authored-by: Michael Co-authored-by: Ben --- crates/agent/src/ui/context_pill.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/agent/src/ui/context_pill.rs b/crates/agent/src/ui/context_pill.rs index 27c9f3a6f1..49303344f3 100644 --- a/crates/agent/src/ui/context_pill.rs +++ b/crates/agent/src/ui/context_pill.rs @@ -216,9 +216,10 @@ impl RenderOnce for ContextPill { }) .when_some(on_click.as_ref(), |element, on_click| { let on_click = on_click.clone(); - element - .cursor_pointer() - .on_click(move |event, window, cx| on_click(event, window, cx)) + element.cursor_pointer().on_click(move |event, window, cx| { + on_click(event, window, cx); + cx.stop_propagation(); + }) }) .into_any_element() } @@ -254,7 +255,10 @@ impl RenderOnce for ContextPill { }) .when_some(on_click.as_ref(), |element, on_click| { let on_click = on_click.clone(); - element.on_click(move |event, window, cx| on_click(event, window, cx)) + element.on_click(move |event, window, cx| { + on_click(event, window, cx); + cx.stop_propagation(); + }) }) .into_any(), }