Skip to content

Commit

Permalink
Handle Shift + Enter // Fix autofocus on end
Browse files Browse the repository at this point in the history
  • Loading branch information
flvndvd committed Dec 22, 2023
1 parent 47aba84 commit b2f597c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ const useCustomEditor = ({

const editor = useEditor(
{
autofocus: true,
autofocus: "end",
enableInputRules: false, // Disable Markdown when typing.
enablePasteRules: false, // Disable Markdown when pasting.
extensions: [
Expand Down Expand Up @@ -179,7 +179,7 @@ const useCustomEditor = ({
class: "border-0 outline-none overflow-y-auto h-full",
},
handleKeyDown: (view, event) => {
if (event.key === "Enter") {
if (event.key === "Enter" && !event.shiftKey) {
// Prevent the default Enter key behavior
event.preventDefault();

Expand Down

0 comments on commit b2f597c

Please sign in to comment.