modal: Fix escape to dismiss Modal when list have selected item. (#1124)

This commit is contained in:
Jason Lee 2025-08-08 12:36:27 +08:00 committed by GitHub
parent 880d023834
commit 900a4aa652
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -327,10 +327,7 @@ where
}
fn on_action_cancel(&mut self, _: &Cancel, window: &mut Window, cx: &mut Context<Self>) {
if self.selected_index.is_none() {
cx.propagate();
}
cx.propagate();
if self.reset_on_cancel {
self._set_selected_index(None, window, cx);
}