Skip to content

Commit e4758f8

Browse files
authored
fix(stage-web): support on pc submit with enter (#549)
1 parent 1aa3b09 commit e4758f8

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

apps/stage-web/src/components/Layouts/MobileInteractiveArea.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ const { send, onAfterMessageComposed, discoverToolsCompatibility } = useChatStor
4040
const { messages } = storeToRefs(useChatStore())
4141
const { t } = useI18n()
4242
43+
function isMobileDevice() {
44+
return /Mobi|Android|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)
45+
}
46+
47+
async function handleSubmit() {
48+
if (!isMobileDevice()) {
49+
await handleSend()
50+
}
51+
}
52+
4353
async function handleSend() {
4454
if (!messageInput.value.trim() || isComposing.value) {
4555
return
@@ -160,7 +170,7 @@ onMounted(() => {
160170
transition="all duration-250 ease-in-out placeholder:all placeholder:duration-250 placeholder:ease-in-out"
161171
:class="[themeColorsHueDynamic ? 'transition-colors-none placeholder:transition-colors-none' : '']"
162172
default-height="1lh"
163-
@submit="() => {}"
173+
@submit="handleSubmit"
164174
@compositionstart="isComposing = true"
165175
@compositionend="isComposing = false"
166176
/>

0 commit comments

Comments
 (0)