From 5066f50c4f73c2cde4ccf6bff43c0ae7d81a1231 Mon Sep 17 00:00:00 2001 From: pengx17 Date: Thu, 6 Feb 2025 10:20:05 +0000 Subject: [PATCH] fix(editor): should focus the textarea will clicking the chat input box (#9983) ![image.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/T2klNLEk0wxLh4NRDzhk/0fc4ec8d-85ba-486b-9d1e-854eff3c0dfc.png) Clicking outside of the textarea should also focuses the textarea --- .../blocksuite/presets/ai/chat-panel/chat-panel-input.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/frontend/core/src/blocksuite/presets/ai/chat-panel/chat-panel-input.ts b/packages/frontend/core/src/blocksuite/presets/ai/chat-panel/chat-panel-input.ts index d468c36b44..3b1fc613cd 100644 --- a/packages/frontend/core/src/blocksuite/presets/ai/chat-panel/chat-panel-input.ts +++ b/packages/frontend/core/src/blocksuite/presets/ai/chat-panel/chat-panel-input.ts @@ -376,7 +376,14 @@ export class ChatPanelInput extends SignalWatcher(WithDisposable(LitElement)) { user-select: none; } -
+
{ + // by default the div will be focused and will blur the textarea + e.preventDefault(); + this.textarea.focus(); + }} + > ${hasImages ? this._renderImages(images) : nothing} ${this.chatContextValue.quote ? html`