color-calendar
color-calendar copied to clipboard
Multiple selected dates in Safari
In Safari (15.5 (17613.2.7.1.8)) there are always two selected dates shown. In Google Crome it works well.
is there any solution? I have, this issue, too. The problem is, that the current day is selected at first, but when I click on another day then today doesn't loose the selected class
I'm with the same problem
did you manage to solve the problem?
Long time ago... I have "fixed" that with a timeout. Not cool, but works
Maybe it helps:
let calendar = new Calendar({
// ...
dateChanged: (currentDate, filteredDateEvents) => {
if (filteredDateEvents.length) {
// ...
// safari fix
setTimeout(() => {
const $activeItems = document.querySelectorAll('.calendar__day-selected');
if ($activeItems.length > 1) {
$activeItems[0].classList.remove('calendar__day-selected');
}
}, 100);
}
}
});```