mattlewis92 / angular-calendar

A flexible calendar component for angular 15.0+ that can display events on a month, week or day view.
https://mattlewis92.github.io/angular-calendar/
MIT License
2.72k stars 863 forks source link

Selected day with event, css class delete issue #1570

Open pukanszkypeter opened 2 years ago

pukanszkypeter commented 2 years ago

Describe the bug

Hi,

i have found an issue when handling day selections on month view. Or am i missing something?

I am adding a css class to a selected day like that: day.cssClass = 'calendar-day-selected' And removing it with: delete day.cssClass

It works perfectly by days with no events. But if a day has events, then delete day.cssClass does nothing on document level. If i print out the cssClass, then it gives me undefined, but on html i still see the class on the element.

In addition i am using the activeDayIsOpen feature to open days with events, i think the issue is in correlation with it, because when i set it to false, then it works fine by days with events.

Is there a solution to remove the cssClass from days with events, when activeDayIsOpen set to true? Or have i missed something?

Thanks in advance!

Minimal reproduction of the problem with instructions

  1. Clicked a day with events, then events opened and selected css class appeared
  2. Clicked same day again, then events closed but css class was still on

Screenshots

  1. image
  2. image

Versions

matts-bot[bot] commented 2 years ago

Thanks so much for opening an issue! If you'd like me to give priority to answering your issue or would just like to support this project, then please consider sponsoring me