diff --git a/package/src/scripts/methods/handlerInput.ts b/package/src/scripts/methods/handlerInput.ts index dabeb964..4c558035 100644 --- a/package/src/scripts/methods/handlerInput.ts +++ b/package/src/scripts/methods/handlerInput.ts @@ -4,8 +4,8 @@ let currentSelf: null | IVanillaCalendar = null; const documentClickEvent = (e: MouseEvent) => { if (!currentSelf) return; - if ((e.target as HTMLElement).closest(`.${currentSelf.CSSClasses.calendar}`)) return; - document.querySelectorAll(`.${currentSelf.CSSClasses.calendar}`).forEach((calendar) => { + if ((e.target as HTMLElement).closest(`.${currentSelf.CSSClasses.calendar}.${currentSelf.CSSClasses.calendarToInput}`)) return; + document.querySelectorAll(`.${currentSelf.CSSClasses.calendar}.${currentSelf.CSSClasses.calendarToInput}`).forEach((calendar) => { calendar.classList.add((currentSelf as IVanillaCalendar).CSSClasses.calendarHidden); }); document.removeEventListener('click', documentClickEvent, { capture: true });