Extend #916 to InlineTextArea and editing of a Text Fragment

This commit is contained in:
Enrico Ros
2026-01-12 03:37:02 -08:00
parent 52e8177f42
commit a9b4b195bf
2 changed files with 4 additions and 0 deletions
@@ -96,6 +96,8 @@ export function BlockEdit_TextFragment(props: {
const handleEditKeyDown = React.useCallback((e: React.KeyboardEvent<HTMLTextAreaElement>) => {
if (e.key === 'Enter') {
if (e.nativeEvent.isComposing)
return;
const withControl = e.ctrlKey;
if (enterIsNewline ? e.shiftKey : !e.shiftKey) {
e.preventDefault();
+2
View File
@@ -40,6 +40,8 @@ export function InlineTextarea(props: {
const handleEditKeyDown = (e: React.KeyboardEvent<HTMLTextAreaElement>) => {
if (e.key === 'Enter') {
if (e.nativeEvent.isComposing)
return;
const shiftOrAlt = e.shiftKey || e.altKey;
if (enterIsNewline ? shiftOrAlt : !shiftOrAlt) {
e.preventDefault();