fix: submit pre chat triggering native submit event (#10224)
This commit is contained in:
@@ -1,10 +1,11 @@
|
|||||||
<script>
|
<script>
|
||||||
import emojis from './emojisGroup.json';
|
import emojis from './emojisGroup.json';
|
||||||
import FluentIcon from 'shared/components/FluentIcon/Index.vue';
|
import FluentIcon from 'shared/components/FluentIcon/Index.vue';
|
||||||
|
import WootButton from 'dashboard/components/ui/WootButton.vue';
|
||||||
const SEARCH_KEY = 'Search';
|
const SEARCH_KEY = 'Search';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: { FluentIcon },
|
components: { FluentIcon, WootButton },
|
||||||
props: {
|
props: {
|
||||||
onClick: {
|
onClick: {
|
||||||
type: Function,
|
type: Function,
|
||||||
@@ -97,7 +98,7 @@ export default {
|
|||||||
class="emoji-search--input focus:box-shadow-blue dark:focus:box-shadow-dark !mb-0 !h-8 !text-sm"
|
class="emoji-search--input focus:box-shadow-blue dark:focus:box-shadow-dark !mb-0 !h-8 !text-sm"
|
||||||
:placeholder="$t('EMOJI.PLACEHOLDER')"
|
:placeholder="$t('EMOJI.PLACEHOLDER')"
|
||||||
/>
|
/>
|
||||||
<woot-button
|
<WootButton
|
||||||
v-if="showRemoveButton"
|
v-if="showRemoveButton"
|
||||||
size="small"
|
size="small"
|
||||||
variant="smooth"
|
variant="smooth"
|
||||||
@@ -106,7 +107,7 @@ export default {
|
|||||||
@click="onClick('')"
|
@click="onClick('')"
|
||||||
>
|
>
|
||||||
{{ $t('EMOJI.REMOVE') }}
|
{{ $t('EMOJI.REMOVE') }}
|
||||||
</woot-button>
|
</WootButton>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="hasNoSearch" ref="emojiItem" class="emoji-item">
|
<div v-if="hasNoSearch" ref="emojiItem" class="emoji-item">
|
||||||
<h5 class="emoji-category--title">
|
<h5 class="emoji-category--title">
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export default {
|
|||||||
default: () => {},
|
default: () => {},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
emits: ['submit'],
|
emits: ['submitPreChat'],
|
||||||
setup() {
|
setup() {
|
||||||
const phoneInput = createInput(PhoneInput, {
|
const phoneInput = createInput(PhoneInput, {
|
||||||
props: ['hasErrorInPhoneInput'],
|
props: ['hasErrorInPhoneInput'],
|
||||||
@@ -252,7 +252,7 @@ export default {
|
|||||||
},
|
},
|
||||||
onSubmit() {
|
onSubmit() {
|
||||||
const { emailAddress, fullName, phoneNumber, message } = this.formValues;
|
const { emailAddress, fullName, phoneNumber, message } = this.formValues;
|
||||||
this.$emit('submit', {
|
this.$emit('submitPreChat', {
|
||||||
fullName,
|
fullName,
|
||||||
phoneNumber,
|
phoneNumber,
|
||||||
emailAddress,
|
emailAddress,
|
||||||
@@ -277,6 +277,7 @@ export default {
|
|||||||
inputClass: 'hidden',
|
inputClass: 'hidden',
|
||||||
wrapperClass: 'hidden',
|
wrapperClass: 'hidden',
|
||||||
}"
|
}"
|
||||||
|
@submit="onSubmit"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-if="shouldShowHeaderMessage"
|
v-if="shouldShowHeaderMessage"
|
||||||
|
|||||||
@@ -61,6 +61,6 @@ export default {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="flex flex-1 overflow-auto">
|
<div class="flex flex-1 overflow-auto">
|
||||||
<PreChatForm :options="preChatFormOptions" @submit="onSubmit" />
|
<PreChatForm :options="preChatFormOptions" @submit-pre-chat="onSubmit" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
Reference in New Issue
Block a user