Skip to content

Commit

Permalink
Submit the new comment form on ctrl/cmd+enter like the reply/edit forms
Browse files Browse the repository at this point in the history
  • Loading branch information
sheodox committed Aug 15, 2023
1 parent 159f266 commit 36a316c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/lib/PostPage.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
<Accordion bind:open={$showNewCommentComposer} buttonClasses="tertiary">
<span slot="title">Leave a comment</span>
{#key $showNewCommentComposer}
<form bind:this={newCommentForm}>
<form bind:this={newCommentForm} use:submitOnHardEnter>
<CommentEditor
submitting={$newCommentState.busy}
bind:value={newCommentText}
Expand Down Expand Up @@ -193,7 +193,13 @@
import ToggleGroup from './ToggleGroup.svelte';
import CommentEditor from './comments/CommentEditor.svelte';
import { getCommentContextId, nameAtInstance } from './nav-utils';
import { createStatefulForm, type ActionFn, localStorageBackedStore, isElementEditable } from './utils';
import {
createStatefulForm,
type ActionFn,
localStorageBackedStore,
isElementEditable,
submitOnHardEnter
} from './utils';
import { getSettingsContext } from './settings-context';
import { createEventDispatcher, onMount } from 'svelte';
import {
Expand Down

0 comments on commit 36a316c

Please sign in to comment.