diff --git a/src/framework/theme/components/chat/_chat.component.theme.scss b/src/framework/theme/components/chat/_chat.component.theme.scss index feed35ffa8..1a8e4b3d06 100644 --- a/src/framework/theme/components/chat/_chat.component.theme.scss +++ b/src/framework/theme/components/chat/_chat.component.theme.scss @@ -266,10 +266,15 @@ flex-direction: row; display: flex; } - - input { + textarea { + resize: none; + max-height: 15em; + height: auto; + overflow-y: auto; + } + input, + textarea { flex: 1; - &.with-button { border-bottom-right-radius: 0; border-top-right-radius: 0; diff --git a/src/framework/theme/components/chat/chat-form.component.ts b/src/framework/theme/components/chat/chat-form.component.ts index 3d1983b0b7..b482675e98 100644 --- a/src/framework/theme/components/chat/chat-form.component.ts +++ b/src/framework/theme/components/chat/chat-form.component.ts @@ -62,7 +62,25 @@ import { NbComponentOrCustomStatus } from '../component-status';
+ } @@ -252,4 +276,13 @@ export class NbChatFormComponent { onModelChange(value: string): void { this.onInputChange.emit(value); } + + adjustTextareaHeight(event: Event): void { + const textarea = event.target as HTMLTextAreaElement; + if (textarea) { + textarea.style.height = 'auto'; + const computedHeight = textarea.scrollHeight; + textarea.style.height = computedHeight + 'px'; + } + } }