fix reseting rounding and better UX

This commit is contained in:
Tiago Vasconcelos 2022-11-17 15:13:21 +00:00 committed by Vlad Stan
parent f4c0c92655
commit 12b69a7f82

View file

@ -230,21 +230,25 @@
:outline="!($q.dark.isActive)" :outline="!($q.dark.isActive)"
rounded rounded
color="primary" color="primary"
label="Custom" label="Round to"
></q-btn> ></q-btn>
<q-input <div class="row q-my-lg" v-if="rounding">
class="q-my-lg" <q-input
ref="inputRounding" class="col"
v-if="rounding" ref="inputRounding"
filled v-model.number="tipRounding"
v-model.number="tipRounding" :placeholder="roundToSugestion"
:placeholder="roundToSugestion" hint="Total amount including tip"
hint="Total amount including tip" :prefix="currency"
>
<!-- <template v-slot:append>
<q-icon name="send" @click="calculatePercent" />
</template> -->
</q-input>
<q-btn class="q-ml-sm" style="margin-bottom: 20px;" color="primary" @click="calculatePercent"
>Ok</q-btn
> >
<template v-slot:append> </div>
<q-icon name="check" @click="calculatePercent" />
</template>
</q-input>
</div> </div>
<div class="row q-mt-lg"> <div class="row q-mt-lg">
<q-btn flat color="primary" @click="processTipSelection(0)" <q-btn flat color="primary" @click="processTipSelection(0)"
@ -478,6 +482,8 @@
}, },
submitForm: function () { submitForm: function () {
if (this.tip_options && this.tip_options.length) { if (this.tip_options && this.tip_options.length) {
this.rounding = false
this.tipRounding = null
this.showTipModal() this.showTipModal()
} else { } else {
this.showInvoice() this.showInvoice()