From 3eb33bf5f445ba7d1da4cc3fa1693978869abea6 Mon Sep 17 00:00:00 2001 From: Professional Date: Sat, 24 May 2025 23:32:02 +0700 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D1=87=D0=B0=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ChatView.vue | 101 +++++++++++++++++++++++++++++++++-------- 1 file changed, 83 insertions(+), 18 deletions(-) diff --git a/src/views/ChatView.vue b/src/views/ChatView.vue index d8648ec..9af0f3a 100644 --- a/src/views/ChatView.vue +++ b/src/views/ChatView.vue @@ -19,14 +19,17 @@

{{ getOtherParticipantName() || 'Собеседник' }}

-

- - - - - - печатает... -

+
+

+ + + + + + печатает... +

+

+
@@ -110,14 +113,15 @@
- + @input="resizeTextarea" + rows="1" + >
@@ -763,6 +767,22 @@ const handleClickOutsideContextMenu = (event) => { contextMenu.value.visible = false; } }; + +const resizeTextarea = (event) => { + const textarea = event.target; + + // Сбрасываем высоту к минимуму для правильного расчета + textarea.style.height = 'auto'; + + // Вычисляем новую высоту на основе содержимого, но не более 150px + const newHeight = Math.min(textarea.scrollHeight, 150); + + // Минимальная высота - одна строка (примерно 38px с учетом padding) + const minHeight = 38; + + // Устанавливаем новую высоту, но не меньше минимальной + textarea.style.height = `${Math.max(minHeight, newHeight)}px`; +};