File tree Expand file tree Collapse file tree 3 files changed +23
-0
lines changed
chat/[agentId]/[conversationId] Expand file tree Collapse file tree 3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 215215 // const editor = lastBotMsg?.rich_content?.editor || '';
216216 loadTextEditor = true ; // TEXT_EDITORS.includes(editor) || !Object.values(EditorType).includes(editor);
217217 loadEditor = ! isSendingMsg && ! isThinking && loadTextEditor && messageQueue .length === 0 ;
218+ if (loadEditor) {
219+ focusChatTextArea ();
220+ }
218221 }
219222
220223 $: {
270273 handleChatAction (e);
271274 }
272275 });
276+
277+ await focusChatTextArea ();
273278 });
274279
275280 function handleLogoutAction () {
276281 resetLocalStorage (true );
277282 }
278283
284+ function focusChatTextArea () {
285+ return new Promise (resolve => {
286+ tick ().then (() => {
287+ const textarea = document .getElementById (' chat-textarea' );
288+ if (textarea) {
289+ textarea .focus ();
290+ }
291+ resolve (' focused' );
292+ });
293+ });
294+ }
295+
279296 /** @param {any} e */
280297 function handleNewChatAction (e ) {
281298 if (! isCreatingNewConv && ! isThinking && ! isSendingMsg) {
19471964 <div class="col">
19481965 <div class="position-relative">
19491966 <ChatTextArea
1967+ id={'chat-textarea'}
19501968 className={` chat- input ${! isLite ? ' chat-more-util' : ' ' }` }
19511969 maxLength={maxTextLength}
19521970 disabled={isSendingMsg || isThinking || disableAction}
Original file line number Diff line number Diff line change 22 import { clickoutsideDirective } from " $lib/helpers/directives" ;
33 import _ from " lodash" ;
44
5+ /** @type {string} */
6+ export let id;
7+
58 /** @type {string} */
69 export let className = ' ' ;
710
110113 < / div>
111114 {/ if }
112115 < textarea
116+ id= {id}
113117 class = {` form-control ${ className} ` }
114118 rows= {rows}
115119 maxlength= {maxLength}
Original file line number Diff line number Diff line change 120120 <div class =" col-10" >
121121 <div class =" position-relative" >
122122 <ChatTextArea
123+ id ={' dashboard-chat-textarea' }
123124 className ={` chat-input ` }
124125 maxLength ={1024 }
125126 disabled ={false }
You can’t perform that action at this time.
0 commit comments