Fix panic caused by focusing the same thing twice
This commit is contained in:
parent
5a711886d4
commit
cc9fb9dea0
3 changed files with 7 additions and 3 deletions
|
@ -36,8 +36,9 @@ impl ModalLayer {
|
|||
let previous_focus = cx.focused();
|
||||
|
||||
if let Some(active_modal) = &self.active_modal {
|
||||
if active_modal.modal.clone().downcast::<V>().is_ok() {
|
||||
self.hide_modal(cx);
|
||||
let is_close = active_modal.modal.clone().downcast::<V>().is_ok();
|
||||
self.hide_modal(cx);
|
||||
if is_close {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue