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 <michael@zed.dev> Co-authored-by: Ben <ben@zed.dev>
This commit is contained in:
parent
23fbab15ee
commit
ad87c545c7
1 changed files with 8 additions and 4 deletions
|
@ -216,9 +216,10 @@ impl RenderOnce for ContextPill {
|
||||||
})
|
})
|
||||||
.when_some(on_click.as_ref(), |element, on_click| {
|
.when_some(on_click.as_ref(), |element, on_click| {
|
||||||
let on_click = on_click.clone();
|
let on_click = on_click.clone();
|
||||||
element
|
element.cursor_pointer().on_click(move |event, window, cx| {
|
||||||
.cursor_pointer()
|
on_click(event, window, cx);
|
||||||
.on_click(move |event, window, cx| on_click(event, window, cx))
|
cx.stop_propagation();
|
||||||
|
})
|
||||||
})
|
})
|
||||||
.into_any_element()
|
.into_any_element()
|
||||||
}
|
}
|
||||||
|
@ -254,7 +255,10 @@ impl RenderOnce for ContextPill {
|
||||||
})
|
})
|
||||||
.when_some(on_click.as_ref(), |element, on_click| {
|
.when_some(on_click.as_ref(), |element, on_click| {
|
||||||
let on_click = on_click.clone();
|
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(),
|
.into_any(),
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue