From 6013bd1c79176ad1ee2cf6743a1436e17ef5edf1 Mon Sep 17 00:00:00 2001 From: Fovway Date: Sun, 2 Nov 2025 12:43:24 +0700 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=BE=20=D0=B0=D0=B2=D1=82=D0=BE=D0=BC=D0=B0=D1=82=D0=B8?= =?UTF-8?q?=D1=87=D0=B5=D1=81=D0=BA=D0=BE=D0=B5=20=D1=84=D0=BE=D0=BA=D1=83?= =?UTF-8?q?=D1=81=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D0=BD?= =?UTF-8?q?=D0=B0=20=D1=82=D0=B5=D0=BA=D1=81=D1=82=D0=BE=D0=B2=D0=BE=D0=BC?= =?UTF-8?q?=20=D0=BF=D0=BE=D0=BB=D0=B5=20=D0=BF=D1=80=D0=B8=20=D0=BF=D0=B5?= =?UTF-8?q?=D1=80=D0=B5=D1=85=D0=BE=D0=B4=D0=B5=20=D0=B2=20=D1=80=D0=B5?= =?UTF-8?q?=D0=B6=D0=B8=D0=BC=20=D1=80=D0=B5=D0=B4=D0=B0=D0=BA=D1=82=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=B7=D0=B0=D0=BC?= =?UTF-8?q?=D0=B5=D1=82=D0=BA=D0=B8.=20=D0=A3=D1=81=D1=82=D0=B0=D0=BD?= =?UTF-8?q?=D0=BE=D0=B2=D0=BB=D0=B5=D0=BD=20=D0=BA=D1=83=D1=80=D1=81=D0=BE?= =?UTF-8?q?=D1=80=20=D0=B2=20=D0=BA=D0=BE=D0=BD=D0=B5=D1=86=20=D1=82=D0=B5?= =?UTF-8?q?=D0=BA=D1=81=D1=82=D0=B0=20=D0=B4=D0=BB=D1=8F=20=D1=83=D0=BB?= =?UTF-8?q?=D1=83=D1=87=D1=88=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BF=D0=BE=D0=BB?= =?UTF-8?q?=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C=D1=81?= =?UTF-8?q?=D0=BA=D0=BE=D0=B3=D0=BE=20=D0=BE=D0=BF=D1=8B=D1=82=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/notes/NoteItem.tsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/components/notes/NoteItem.tsx b/src/components/notes/NoteItem.tsx index f939c77..83ecb80 100644 --- a/src/components/notes/NoteItem.tsx +++ b/src/components/notes/NoteItem.tsx @@ -755,6 +755,20 @@ export const NoteItem: React.FC = ({ }; }, [isEditing, editContent]); + // Фокусировка на textarea при переходе в режим редактирования + useEffect(() => { + if (isEditing && editTextareaRef.current && !localPreviewMode) { + setTimeout(() => { + editTextareaRef.current?.focus(); + // Устанавливаем курсор в конец текста + const textarea = editTextareaRef.current; + if (textarea) { + textarea.setSelectionRange(editContent.length, editContent.length); + } + }, 100); + } + }, [isEditing, localPreviewMode, editContent]); + // Отслеживание выделения текста useEffect(() => { if (!isEditing) return;