mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-22 21:11:14 +00:00
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:
@@ -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')}
|
||||
|
||||
Reference in New Issue
Block a user