Timothy Jaeryang Baek 4 miesięcy temu
rodzic
commit
a27a095884
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      src/lib/components/common/RichTextInput.svelte

+ 2 - 1
src/lib/components/common/RichTextInput.svelte

@@ -301,7 +301,8 @@
 							}
 							}
 
 
 							if (event.key === 'Enter') {
 							if (event.key === 'Enter') {
-								if (event.shiftKey) {
+								const isCtrlPressed = event.ctrlKey || event.metaKey; // metaKey is for Cmd key on Mac
+								if (event.shiftKey && !isCtrlPressed) {
 									editor.commands.setHardBreak(); // Insert a hard break
 									editor.commands.setHardBreak(); // Insert a hard break
 									view.dispatch(view.state.tr.scrollIntoView()); // Move viewport to the cursor
 									view.dispatch(view.state.tr.scrollIntoView()); // Move viewport to the cursor
 									event.preventDefault();
 									event.preventDefault();