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) => {
|
||||
setValues({ date: invertDate(newProxy) });
|
||||
const btn = document.querySelector(".buttons-close-modal button")
|
||||
if(btn) btn.click()
|
||||
//if(btn) btn.click()
|
||||
});
|
||||
|
||||
const LOCALE = {
|
||||
|
|
|
@ -62,6 +62,7 @@ export default defineComponent({
|
|||
postalCodeValid.value.isValid = false;
|
||||
} else {
|
||||
postalCodeValid.value.isValid = true;
|
||||
document.querySelector("#carousel-form .calendar .custom-date-btn").click();
|
||||
}
|
||||
|
||||
postalCodeValid.value.dataOptions = dates;
|
||||
|
|
|
@ -53,7 +53,7 @@ export default defineComponent({
|
|||
|
||||
function handleFormKeyPress() {
|
||||
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) =>{
|
||||
if (e.target.value.length === lengthCp) {
|
||||
isEventKeyActive = true;
|
||||
|
@ -63,7 +63,7 @@ export default defineComponent({
|
|||
if (e.target.value.length === lengthCp && isEventKeyActive) {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
if(postalCodeValid.value.isValid) modalDate.click();
|
||||
postalCodeField.blur();
|
||||
isEventKeyActive = false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue