Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(editor): should focus the textarea will clicking the chat input box (#9983)

pengx175066f50c4f73
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;
}
</style>
- <div class="chat-panel-input">
+ <div
+ class="chat-panel-input"
+ @pointerdown=${(e: MouseEvent) => {
+ // 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`<div class="chat-selection-quote">