From f25266ec8853a1985767fcb6f7299643ec22dccf Mon Sep 17 00:00:00 2001 From: pengx17 Date: Thu, 27 Feb 2025 02:26:57 +0000 Subject: [PATCH] fix(editor): ai chat panel textarea selection issue (#10461) fix AF-2244 --- .../core/src/blocksuite/ai/chat-panel/chat-panel-input.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/frontend/core/src/blocksuite/ai/chat-panel/chat-panel-input.ts b/packages/frontend/core/src/blocksuite/ai/chat-panel/chat-panel-input.ts index 6a250f203..55f91f5ff 100644 --- a/packages/frontend/core/src/blocksuite/ai/chat-panel/chat-panel-input.ts +++ b/packages/frontend/core/src/blocksuite/ai/chat-panel/chat-panel-input.ts @@ -303,9 +303,11 @@ export class ChatPanelInput extends SignalWatcher(WithDisposable(LitElement)) {
{ - // by default the div will be focused and will blur the textarea - e.preventDefault(); - this.textarea.focus(); + if (e.target !== this.textarea) { + // by default the div will be focused and will blur the textarea + e.preventDefault(); + this.textarea.focus(); + } }} > ${hasImages