add expand prop

pull/220/head^2
Pete Matsyburka 2 years ago
parent 866aab7fac
commit 02adbae758

@ -17,7 +17,7 @@
v-if="!isFormVisible" v-if="!isFormVisible"
id="expand_form_button" id="expand_form_button"
class="btn btn-neutral flex text-white absolute rounded-none border-x-0 md:border md:rounded-full bottom-0 w-full md:mb-4 text-base" class="btn btn-neutral flex text-white absolute rounded-none border-x-0 md:border md:rounded-full bottom-0 w-full md:mb-4 text-base"
@click.prevent="isFormVisible = true" @click.prevent="[isFormVisible = true, scrollIntoField(currentField)]"
> >
{{ t('submit_form') }} {{ t('submit_form') }}
<IconArrowsDiagonal <IconArrowsDiagonal
@ -486,6 +486,11 @@ export default {
return () => {} return () => {}
} }
}, },
expand: {
type: Boolean,
required: false,
default: true
},
withConfetti: { withConfetti: {
type: Boolean, type: Boolean,
required: false, required: false,
@ -585,7 +590,7 @@ export default {
data () { data () {
return { return {
isCompleted: false, isCompleted: false,
isFormVisible: true, isFormVisible: this.expand,
showFillAllRequiredFields: false, showFillAllRequiredFields: false,
currentStep: 0, currentStep: 0,
isSubmitting: false, isSubmitting: false,
@ -657,6 +662,11 @@ export default {
return `/s/${this.submitterSlug}` return `/s/${this.submitterSlug}`
} }
}, },
watch: {
expand (value) {
this.isFormVisible = value
}
},
mounted () { mounted () {
this.submittedValues = JSON.parse(JSON.stringify(this.values)) this.submittedValues = JSON.parse(JSON.stringify(this.values))

Loading…
Cancel
Save