fix: don't pass keyboard events to content if popover modal is open
This commit is contained in:
parent
c3ced76094
commit
9cc82abd9c
1 changed files with 11 additions and 3 deletions
|
|
@ -157,9 +157,17 @@ where
|
||||||
) {
|
) {
|
||||||
if self.popup.is_some() {
|
if self.popup.is_some() {
|
||||||
if self.modal {
|
if self.modal {
|
||||||
if matches!(event, Event::Mouse(_) | Event::Touch(_)) {
|
match event {
|
||||||
shell.capture_event();
|
Event::Mouse(_) | Event::Touch(_) => {
|
||||||
return;
|
shell.capture_event();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// app-level keyboard navigation (Tab focus cycling, Escape)
|
||||||
|
// still receives keyboard events
|
||||||
|
Event::Keyboard(_) => {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
_ => {}
|
||||||
}
|
}
|
||||||
} else if let Some(on_close) = self.on_close.as_ref() {
|
} else if let Some(on_close) = self.on_close.as_ref() {
|
||||||
if matches!(
|
if matches!(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue