From f6881cf3805ace468f9107f1ffe690f80c6dd38d Mon Sep 17 00:00:00 2001 From: Cole Lashley Date: Tue, 30 Apr 2024 17:16:03 -0700 Subject: [PATCH] Ai chat select fix (#622) --- src/app/workspace/cmdinput/aichat.tsx | 6 +++++- src/models/input.ts | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app/workspace/cmdinput/aichat.tsx b/src/app/workspace/cmdinput/aichat.tsx index 8ddc099a..b671a733 100644 --- a/src/app/workspace/cmdinput/aichat.tsx +++ b/src/app/workspace/cmdinput/aichat.tsx @@ -113,7 +113,7 @@ class AIChat extends React.Component<{}, {}> { @mobx.action.bound onTextAreaBlur(e: any) { - GlobalModel.inputModel.setAuxViewFocus(false); + //GlobalModel.inputModel.setAuxViewFocus(false); } // Adjust the height of the textarea to fit the text @@ -132,6 +132,9 @@ class AIChat extends React.Component<{}, {}> { // Set the new height of the text area, bounded by the min and max height. const newHeight = Math.min(Math.max(scrollHeight, textAreaMinHeight), textAreaMaxHeight); this.textAreaRef.current.style.height = newHeight + "px"; + } + + onTextAreaInput(e: any) { GlobalModel.inputModel.codeSelectDeselectAll(); } @@ -264,6 +267,7 @@ class AIChat extends React.Component<{}, {}> { onFocus={this.onTextAreaFocused} onBlur={this.onTextAreaBlur} onChange={this.onTextAreaChange} + onInput={this.onTextAreaInput} onKeyDown={this.onKeyDown} style={{ fontSize: this.termFontSize }} className="chat-textarea" diff --git a/src/models/input.ts b/src/models/input.ts index 5fa96110..b1323d89 100644 --- a/src/models/input.ts +++ b/src/models/input.ts @@ -591,7 +591,8 @@ class InputModel { } } this.codeSelectBlockRefArray = []; - this.setAIChatFocus(); + this.setActiveAuxView(appconst.InputAuxView_AIChat); + this.setAuxViewFocus(true); } @mobx.action