fix: Skip auto-focus on mobile to prevent keyboard from opening on prompt bar show
This commit is contained in:
@@ -34,8 +34,10 @@ function focus() {
|
|||||||
inputEl.value?.focus()
|
inputEl.value?.focus()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isMobile = () => window.innerWidth < 480
|
||||||
|
|
||||||
watch(() => props.autofocus, async (v) => {
|
watch(() => props.autofocus, async (v) => {
|
||||||
if (v) {
|
if (v && !isMobile()) {
|
||||||
await nextTick()
|
await nextTick()
|
||||||
focus()
|
focus()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -651,7 +651,7 @@ watch(() => props.visible, async (v) => {
|
|||||||
await nextTick()
|
await nextTick()
|
||||||
if (props.startRecording) {
|
if (props.startRecording) {
|
||||||
handleMic()
|
handleMic()
|
||||||
} else {
|
} else if (window.innerWidth >= 480) {
|
||||||
chatInputEl.value?.focus()
|
chatInputEl.value?.focus()
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user