From 33d15bec56247697f2b05fc9de2c4dd8d6eb9828 Mon Sep 17 00:00:00 2001 From: bflatastic Date: Fri, 30 Oct 2026 17:12:16 +0700 Subject: [PATCH] Fields: only a plain Enter commits a field early, so Ctrl/Cmd+Enter in X or Y keeps editing --- crates/ui-egui/src/widgets/text.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/widgets/text.rs b/crates/ui-egui/src/widgets/text.rs index 2c4d25f70..a8aa9e802 100644 --- a/crates/ui-egui/src/widgets/text.rs +++ b/crates/ui-egui/src/widgets/text.rs @@ -290,7 +290,8 @@ pub(super) fn recessed_text( d.insert_temp(id, buf.clone()); d.insert_temp(focus_id, focused); }); - let enter_commit = rows == 1 && editing && ui.input(|i| i.key_pressed(egui::Key::Enter)); + // Plain Enter only: Ctrl/Cmd+Enter keeps editing a field that takes it (X and Y in Transform). + let enter_commit = rows == 1 && editing && ui.input(|i| i.key_pressed(egui::Key::Enter) && i.modifiers.is_none()); let commit = resp.lost_focus() || kept || enter_commit; (buf, commit, resp, rect) }