Skip to content

Commit

Permalink
Merge pull request #88 from uvarov-frontend/fix/87_multiple_input_cal…
Browse files Browse the repository at this point in the history
…endars

FIX: Multiple input calendars issue
  • Loading branch information
uvarov-frontend authored Jun 21, 2023
2 parents 2b423f6 + 69985b8 commit 2fad816
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package/build/vanilla-calendar.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@uvarov.frontend/vanilla-calendar",
"version": "2.6.0",
"version": "2.6.1",
"description": "VanillaCalendar is a pure JavaScript date and time picker that uses TypeScript so it supports any JS framework and library.",
"homepage": "https://vanilla-calendar.com",
"keywords": [
Expand Down
4 changes: 3 additions & 1 deletion package/src/scripts/methods/handlerInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ let currentSelf: null | IVanillaCalendar = null;
const documentClickEvent = (e: MouseEvent) => {
if (!currentSelf) return;
if ((e.target as HTMLElement).closest(`.${currentSelf.CSSClasses.calendar}`)) return;
currentSelf.HTMLElement?.classList.add(currentSelf.CSSClasses.calendarHidden);
document.querySelectorAll(`.${currentSelf.CSSClasses.calendar}`).forEach((calendar) => {
calendar.classList.add((currentSelf as IVanillaCalendar).CSSClasses.calendarHidden);
});
document.removeEventListener('click', documentClickEvent, { capture: true });
};

Expand Down

0 comments on commit 2fad816

Please sign in to comment.