diff --git a/src/app/workspace/cmdinput/aichat.tsx b/src/app/workspace/cmdinput/aichat.tsx index 8ddc099a4..b671a7330 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 5fa961100..b1323d893 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