Skip to content

Commit

Permalink
Merge pull request #125 from uvarov-frontend/hotfix/hidden_input_cale…
Browse files Browse the repository at this point in the history
…ndar

Hotfix hidden "calendar-input"
  • Loading branch information
uvarov-frontend authored Oct 3, 2023
2 parents c078c2d + 12e393c commit fbdf60e
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 fbdf60e

Please sign in to comment.