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>
<div class="row q-my-lg" v-if="rounding">
<q-input <q-input
class="q-my-lg" class="col"
ref="inputRounding" ref="inputRounding"
v-if="rounding"
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> <!-- <template v-slot:append>
<q-icon name="check" @click="calculatePercent" /> <q-icon name="send" @click="calculatePercent" />
</template> </template> -->
</q-input> </q-input>
<q-btn class="q-ml-sm" style="margin-bottom: 20px;" color="primary" @click="calculatePercent"
>Ok</q-btn
>
</div>
</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()