Skip to content

Commit

Permalink
fix search selector input
Browse files Browse the repository at this point in the history
  • Loading branch information
uvarov-frontend committed Oct 3, 2023
1 parent c078c2d commit 12e393c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package/src/scripts/methods/handlerInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down

0 comments on commit 12e393c

Please sign in to comment.