Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import type { AIChatOptions, CommandResult } from './types';

const mockWidgetInstance = {
option: jest.fn(),
blur: jest.fn(),
focus: jest.fn(),
};

jest.mock('../m_utils', () => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { Message, Properties as ChatProperties } from '@js/ui/chat';
import Chat from '@js/ui/chat';
import type { Properties as PopupProperties, ToolbarItem } from '@js/ui/popup';
import { MessageStatus } from '@ts/grids/grid_core/ai_assistant/const';
import type ChatTextArea from '@ts/ui/chat/message_box/chat_text_area';
import {
CHAT_MESSAGELIST_EMPTY_IMAGE_CLASS,
CHAT_MESSAGELIST_EMPTY_MESSAGE_CLASS,
Expand Down Expand Up @@ -257,7 +258,14 @@ export class AIChat {
const $textArea = this.chatInstance?.$element().find(`.${CLASSES.textArea}`);

if ($textArea?.length) {
gridCoreUtils.getWidgetInstance($textArea)?.option('disabled', disabled);
const chatTextAreaInstance: ChatTextArea = gridCoreUtils.getWidgetInstance($textArea);
chatTextAreaInstance?.option('disabled', disabled);

if (disabled) {
chatTextAreaInstance?.blur();
} else {
chatTextAreaInstance?.focus();
}
}
}

Expand Down
Loading