Merge pull request #326 from Safelite/feature/digital/SSR-501
refactored prevent input on datetime and fixed spacebar not closing m…
This commit is contained in:
commit
3a7fc7d37c
2 changed files with 11 additions and 6 deletions
|
|
@ -20,6 +20,7 @@
|
||||||
type="button"
|
type="button"
|
||||||
class="btn-close"
|
class="btn-close"
|
||||||
@mousedown="closeModal"
|
@mousedown="closeModal"
|
||||||
|
@keypress.space="closeModal"
|
||||||
aria-label="Close"></button>
|
aria-label="Close"></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body ps-5 pe-5 pb-4 pt-0">
|
<div class="modal-body ps-5 pe-5 pb-4 pt-0">
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@
|
||||||
class="form-control"
|
class="form-control"
|
||||||
v-model.trim="value"
|
v-model.trim="value"
|
||||||
v-maska="mask"
|
v-maska="mask"
|
||||||
v-on:focus="blurInput"
|
@keydown="preventDateInput"
|
||||||
:type="type"
|
:type="type"
|
||||||
:ref="inputId"
|
:ref="inputId"
|
||||||
:id="inputId"
|
:id="inputId"
|
||||||
|
|
@ -139,9 +139,13 @@ export default {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
blurInput() {
|
preventDateInput(evt) {
|
||||||
if (this.$refs.dateOfLossField) {
|
if (this.type === "date") {
|
||||||
this.$refs.dateOfLossField.blur();
|
if (/\d/.test(evt.key)) {
|
||||||
|
evt.stopPropagation();
|
||||||
|
evt.preventDefault();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue