Fields: only a plain Enter commits a field early, so Ctrl/Cmd+Enter in X or Y keeps editing

This commit is contained in:
bflatastic
2026-10-30 17:12:16 +07:00
parent a385b5cbf5
commit 33d15bec56
+2 -1
View File
@@ -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)
}