File tree Expand file tree Collapse file tree
docs/app/components/content
layer/modules/assistant/runtime/components Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,6 +148,7 @@ function resetChat() {
148148 :disabled =" ! isEnabled "
149149 :placeholder =" t (' assistant.askAnything' )"
150150 variant="subtle"
151+ :autofocus =" false "
151152 size="sm"
152153 @submit =" handleSubmit "
153154 >
Original file line number Diff line number Diff line change @@ -23,6 +23,12 @@ const open = computed({
2323 },
2424})
2525
26+ const promptRef = ref <{ textareaRef? : HTMLTextAreaElement } | null >(null )
27+ watch (open , (value ) => {
28+ if (! value ) return
29+ nextTick (() => promptRef .value ?.textareaRef ?.focus ({ preventScroll: true }))
30+ })
31+
2632const displayTitle = computed (() => t (' assistant.title' ))
2733const displayPlaceholder = computed (() => t (' assistant.placeholder' ))
2834
@@ -273,6 +279,7 @@ defineShortcuts({
273279
274280 <template #footer >
275281 <UChatPrompt
282+ ref="promptRef"
276283 v-model =" input "
277284 :error =" chat .error "
278285 :placeholder =" displayPlaceholder "
You can’t perform that action at this time.
0 commit comments