table: Fix ESC event not propagating to modal with selection (#1183)

This commit is contained in:
Floyd Wang 2025-08-29 10:52:30 +08:00 committed by GitHub
parent 74b3aa7e67
commit f98ad5232b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -378,8 +378,16 @@ where
self.set_selected_col(col_ix, cx)
}
fn has_selection(&self) -> bool {
self.selected_row.is_some() || self.selected_col.is_some()
}
fn action_cancel(&mut self, _: &Cancel, _: &mut Window, cx: &mut Context<Self>) {
self.clear_selection(cx);
if self.has_selection() {
self.clear_selection(cx);
return;
}
cx.propagate();
}
fn action_select_prev(&mut self, _: &SelectPrev, _: &mut Window, cx: &mut Context<Self>) {