From 12e393c693df2fecd52d30f2d4e49fae7938363c Mon Sep 17 00:00:00 2001 From: Yury Uvarov Date: Tue, 3 Oct 2023 11:15:14 +0300 Subject: [PATCH] fix search selector input --- package/src/scripts/methods/handlerInput.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 });