Forms: Cmd-Enter submits from any control in a form
Form sets the ElyForm key context and binds secondary-enter to Submit under it, so a focused tile, chip or button submits too. The prompt enhancer's wash trims anything but letters and digits from its runs, its spacing sits on its parts so nothing gaps at rest, and its tests check that the field takes focus back.
This commit is contained in:
6 files changed
+51
-12
No files matched your search
@@ -9,6 +9,7 @@ use super::{
|
||||
edit::{self, next_grapheme, prev_grapheme},
|
||||
element::TextElement,
|
||||
};
|
||||
use crate::forms::structure::FORM_CONTEXT;
|
||||
|
||||
actions!(
|
||||
ely_input,
|
||||
@@ -87,6 +88,7 @@ pub(crate) fn bind_keys(cx: &mut App) {
|
||||
KeyBinding::new("enter", Enter, Some(CONTEXT)),
|
||||
KeyBinding::new("shift-enter", Newline, Some(CONTEXT)),
|
||||
KeyBinding::new("secondary-enter", Submit, Some(CONTEXT)),
|
||||
KeyBinding::new("secondary-enter", Submit, Some(FORM_CONTEXT)),
|
||||
];
|
||||
if cfg!(target_os = "macos") {
|
||||
bindings.extend([
|
||||
|
||||
Reference in new issue
Block a user