mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-10 21:50:14 -07:00
Extend #916 to InlineTextArea and editing of a Text Fragment
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user