modal: Fix escape to dismiss Modal when list have selected item. (#1124)
This commit is contained in:
parent
880d023834
commit
900a4aa652
1 changed files with 1 additions and 4 deletions
|
|
@ -327,10 +327,7 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
fn on_action_cancel(&mut self, _: &Cancel, window: &mut Window, cx: &mut Context<Self>) {
|
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 {
|
if self.reset_on_cancel {
|
||||||
self._set_selected_index(None, window, cx);
|
self._set_selected_index(None, window, cx);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue