fix(terminal): a click beside the covering composer leaves it, as one on the grid does

This commit is contained in:
l0ng-ai
2026-10-01 15:27:59 +08:00
parent 15efbcb992
commit e74a29336b
+12
View File
@@ -1343,6 +1343,15 @@ impl TerminalView {
.pb(px(BOX_INSET))
.bg(cx.theme().background)
.occlude()
// Around the box is the terminal as far as a click goes: it
// takes the keyboard out of the box, as a click on the rows
// above does. The layer only hides what is under it.
.on_mouse_down(
MouseButton::Left,
cx.listener(|this, _: &MouseDownEvent, window, cx| {
window.focus(&this.focus_handle, cx);
}),
)
.child(frame)
.into_any_element(),
None => div()
@@ -1816,6 +1825,9 @@ impl TerminalView {
MouseButton::Left,
cx.listener(|this, _: &MouseDownEvent, window, cx| {
window.prevent_default();
// Not the layer under it, which takes a click as one
// on the terminal.
cx.stop_propagation();
// A click on the frame around the text, not only on
// the text, is a click on the box.
if !this.composer_focused {