Stop propagation on split-pane close so the pane doesn't reselect
Same fix as `adb278b` but for the split-pane close glyph: clicking × fires the pane wrapper's `on_click(select_tab)` after the close runs. Add `cx.stop_propagation()` so the close ends at the glyph.
This commit is contained in:
@@ -90,8 +90,12 @@ fn render_close_glyph(close_tab_id: TabId, cx: &mut Context<ElyShell>) -> AnyEle
|
||||
.cursor_pointer()
|
||||
.hover(|style| style.text_color(rgb(colors::INK)))
|
||||
.on_click(cx.listener(move |shell, _, window, cx| {
|
||||
// The split pane itself has an on_click that selects the
|
||||
// tab. Stop propagation here so closing the pane doesn't
|
||||
// also re-select the just-removed tab.
|
||||
shell.select_tab(&close_tab_id, window, cx);
|
||||
shell.close_active_tab(window, cx);
|
||||
cx.stop_propagation();
|
||||
}))
|
||||
.child(IconName::Close)
|
||||
.into_any_element()
|
||||
|
||||
Reference in New Issue
Block a user