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:
Jason Wheeler 2023-05-30 12:34:24 -04:00 committed by GitHub
commit 3a7fc7d37c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 6 deletions

View file

@ -20,6 +20,7 @@
type="button"
class="btn-close"
@mousedown="closeModal"
@keypress.space="closeModal"
aria-label="Close"></button>
</div>
<div class="modal-body ps-5 pe-5 pb-4 pt-0">

View file

@ -16,7 +16,7 @@
class="form-control"
v-model.trim="value"
v-maska="mask"
v-on:focus="blurInput"
@keydown="preventDateInput"
:type="type"
:ref="inputId"
:id="inputId"
@ -139,11 +139,15 @@ export default {
},
blurInput() {
if (this.$refs.dateOfLossField) {
this.$refs.dateOfLossField.blur();
}
}
preventDateInput(evt) {
if (this.type === "date") {
if (/\d/.test(evt.key)) {
evt.stopPropagation();
evt.preventDefault();
return false;
}
}
}
},
computed: {