Si no hay fechas, no hacer click en el calendario
This commit is contained in:
parent
fded48a627
commit
9836fc1b5a
|
@ -37,7 +37,7 @@ export default defineComponent({
|
||||||
watch(proxyDate, (newProxy) => {
|
watch(proxyDate, (newProxy) => {
|
||||||
setValues({ date: invertDate(newProxy) });
|
setValues({ date: invertDate(newProxy) });
|
||||||
const btn = document.querySelector(".buttons-close-modal button")
|
const btn = document.querySelector(".buttons-close-modal button")
|
||||||
if(btn) btn.click()
|
//if(btn) btn.click()
|
||||||
});
|
});
|
||||||
|
|
||||||
const LOCALE = {
|
const LOCALE = {
|
||||||
|
|
|
@ -62,6 +62,7 @@ export default defineComponent({
|
||||||
postalCodeValid.value.isValid = false;
|
postalCodeValid.value.isValid = false;
|
||||||
} else {
|
} else {
|
||||||
postalCodeValid.value.isValid = true;
|
postalCodeValid.value.isValid = true;
|
||||||
|
document.querySelector("#carousel-form .calendar .custom-date-btn").click();
|
||||||
}
|
}
|
||||||
|
|
||||||
postalCodeValid.value.dataOptions = dates;
|
postalCodeValid.value.dataOptions = dates;
|
||||||
|
|
|
@ -53,7 +53,7 @@ export default defineComponent({
|
||||||
|
|
||||||
function handleFormKeyPress() {
|
function handleFormKeyPress() {
|
||||||
const postalCodeField = document.querySelector("#carousel-form .postal-code-control input");
|
const postalCodeField = document.querySelector("#carousel-form .postal-code-control input");
|
||||||
const modalDate = document.querySelector("#carousel-form .calendar .custom-date-btn");
|
//const modalDate = document.querySelector("#carousel-form .calendar .custom-date-btn");
|
||||||
postalCodeField.addEventListener('input', (e) =>{
|
postalCodeField.addEventListener('input', (e) =>{
|
||||||
if (e.target.value.length === lengthCp) {
|
if (e.target.value.length === lengthCp) {
|
||||||
isEventKeyActive = true;
|
isEventKeyActive = true;
|
||||||
|
@ -63,7 +63,7 @@ export default defineComponent({
|
||||||
if (e.target.value.length === lengthCp && isEventKeyActive) {
|
if (e.target.value.length === lengthCp && isEventKeyActive) {
|
||||||
if (e.key === 'Enter') {
|
if (e.key === 'Enter') {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if(postalCodeValid.value.isValid) modalDate.click();
|
postalCodeField.blur();
|
||||||
isEventKeyActive = false;
|
isEventKeyActive = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue