Skip to content

DesignCraft: An open-source page and layout design editor written by scratch in pure Rust

Integration: Numbering & Section Options keeps Enter and Escape for an open popup

aiongg4e5e040a79bc
diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs
index b96f4881d..a85cdb7ef 100644
--- a/crates/ui-egui/src/dialogs.rs
+++ b/crates/ui-egui/src/dialogs.rs
@@ -1208,10 +1208,10 @@ pub fn show(app: &mut DesignApp, ctx: &egui::Context) {
if let Some(ok) = crate::section_options::actions(app, &mut actions) {
result = Some(ok);
}
- if ui.input(|i| i.key_pressed(egui::Key::Enter)) {
+ if !popup_open && ui.input(|i| i.key_pressed(egui::Key::Enter)) {
result = Some(true);
}
- if ui.input(|i| i.key_pressed(egui::Key::Escape)) {
+ if !popup_open && ui.input(|i| i.key_pressed(egui::Key::Escape)) {
result = Some(false);
}
}