fix: submit pre chat triggering native submit event (#10224)
This commit is contained in:
@@ -25,7 +25,7 @@ export default {
|
||||
default: () => {},
|
||||
},
|
||||
},
|
||||
emits: ['submit'],
|
||||
emits: ['submitPreChat'],
|
||||
setup() {
|
||||
const phoneInput = createInput(PhoneInput, {
|
||||
props: ['hasErrorInPhoneInput'],
|
||||
@@ -252,7 +252,7 @@ export default {
|
||||
},
|
||||
onSubmit() {
|
||||
const { emailAddress, fullName, phoneNumber, message } = this.formValues;
|
||||
this.$emit('submit', {
|
||||
this.$emit('submitPreChat', {
|
||||
fullName,
|
||||
phoneNumber,
|
||||
emailAddress,
|
||||
@@ -277,6 +277,7 @@ export default {
|
||||
inputClass: 'hidden',
|
||||
wrapperClass: 'hidden',
|
||||
}"
|
||||
@submit="onSubmit"
|
||||
>
|
||||
<div
|
||||
v-if="shouldShowHeaderMessage"
|
||||
|
||||
@@ -61,6 +61,6 @@ export default {
|
||||
|
||||
<template>
|
||||
<div class="flex flex-1 overflow-auto">
|
||||
<PreChatForm :options="preChatFormOptions" @submit="onSubmit" />
|
||||
<PreChatForm :options="preChatFormOptions" @submit-pre-chat="onSubmit" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user