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"
|
||||
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">
|
||||
|
|
|
|||
|
|
@ -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: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue