Remove keydown.enter events that disable the submission for line items
This commit is contained in:
parent
ccaa724a3f
commit
f0b37c3bc9
13
resources/assets/js/views/common/documents.js
vendored
13
resources/assets/js/views/common/documents.js
vendored
@ -97,18 +97,7 @@ const app = new Vue({
|
|||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
onRefFocus(ref, index) {
|
onRefFocus(ref, index) {
|
||||||
this.disableFormSubmission();
|
setPromiseTimeout(100).then(() => this.$refs[ref][index].focus());
|
||||||
|
|
||||||
ref
|
|
||||||
? ref === 'price'
|
|
||||||
? setPromiseTimeout(100).then(() => this.$refs[ref][index].$children[0].$el.focus())
|
|
||||||
: setPromiseTimeout(100).then(() => this.$refs[ref][index].focus())
|
|
||||||
: {}
|
|
||||||
},
|
|
||||||
|
|
||||||
disableFormSubmission() {
|
|
||||||
const saveButtonEl = document.getElementsByClassName("btn btn-icon btn-success")[0];
|
|
||||||
saveButtonEl.setAttribute("type", "button");
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onCalculateTotal() {
|
onCalculateTotal() {
|
||||||
|
@ -42,8 +42,7 @@
|
|||||||
data-item="name"
|
data-item="name"
|
||||||
v-model="row.name"
|
v-model="row.name"
|
||||||
@input="onBindingItemField(index, 'name')"
|
@input="onBindingItemField(index, 'name')"
|
||||||
@change="form.errors.clear('items.' + index + '.name')"
|
@change="form.errors.clear('items.' + index + '.name')"/>
|
||||||
@keydown.enter="onRefFocus('description', index)">
|
|
||||||
<div class="invalid-feedback d-block"
|
<div class="invalid-feedback d-block"
|
||||||
v-if="form.errors.has('items.' + index + '.name')"
|
v-if="form.errors.has('items.' + index + '.name')"
|
||||||
v-html="form.errors.get('items.' + index + '.name')">
|
v-html="form.errors.get('items.' + index + '.name')">
|
||||||
@ -68,7 +67,6 @@
|
|||||||
resize="none"
|
resize="none"
|
||||||
@input="onBindingItemField(index, 'description')"
|
@input="onBindingItemField(index, 'description')"
|
||||||
@keydown.enter.exact.prevent
|
@keydown.enter.exact.prevent
|
||||||
@keydown.enter.exact="onRefFocus('quantity', index)"
|
|
||||||
></textarea>
|
></textarea>
|
||||||
@endif
|
@endif
|
||||||
</td>
|
</td>
|
||||||
@ -92,8 +90,7 @@
|
|||||||
data-item="quantity"
|
data-item="quantity"
|
||||||
v-model="row.quantity"
|
v-model="row.quantity"
|
||||||
@input="onCalculateTotal"
|
@input="onCalculateTotal"
|
||||||
@change="form.errors.clear('items.' + index + '.quantity')"
|
@change="form.errors.clear('items.' + index + '.quantity')">
|
||||||
@keydown.enter="onRefFocus('price', index)">
|
|
||||||
<div class="invalid-feedback d-block"
|
<div class="invalid-feedback d-block"
|
||||||
v-if="form.errors.has('items.' + index + '.quantity')"
|
v-if="form.errors.has('items.' + index + '.quantity')"
|
||||||
v-html="form.errors.get('items.' + index + '.quantity')">
|
v-html="form.errors.get('items.' + index + '.quantity')">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user