feat(dialogs): save a dialog with Ctrl/Cmd+Enter (#1303)

Ctrl/Cmd+Enter in any field of a DialogShell presses its one primary footer
button, focusing it first so blur-committed fields keep their value. Dialogs
with no or several primaries leave the keys to the field, as does the journal
story editor, which opts out with data-keeps-ctrl-enter.
This commit is contained in:
Maurice
2026-11-13 09:25:24 +01:00
parent 8401428ca7
commit 208af03212
3 changed files with 165 additions and 6 deletions
@@ -465,8 +465,10 @@ export function EntryEditor({ entry, journeyId, tripDates, galleryPhotos, trips,
<div className="flex min-h-[220px] flex-1 flex-col overflow-hidden rounded-[10px] border border-edge bg-surface-input focus-within:ring-2 focus-within:ring-[color:var(--text-primary)]">
<MarkdownToolbar textareaRef={storyRef} onUpdate={setStory} />
{/* Written like a long text: Ctrl/Cmd+Enter stays with the story instead of saving the entry. */}
<textarea
ref={storyRef}
data-keeps-ctrl-enter
value={story}
onChange={e => setStory(e.target.value)}
placeholder={t('journey.editor.writeStory')}