react-calendar icon indicating copy to clipboard operation
react-calendar copied to clipboard

react-calendar__tile--active stays on even if value was cleared

Open lemontini opened this issue 1 year ago • 0 comments

Before you start - checklist

  • [X] I followed instructions in documentation written for my React-Calendar version
  • [X] I have checked if this bug is not already reported

Description

The class indicating active ("selected") state of a tile in month view (class react-calendar__tile--active) is not removed if the value supplied to react-calendar is cleared (e.g. setValue(undefined)). The only workaround is to use tileClassName and set the custom selected class to style active ("selected") day accordingly.

Steps to reproduce

screen recording provided.

Expected behavior

react-calendar__tile--active is removed from all tiles, as no value is selected (value=undefined)

Actual behavior

react-calendar__tile--active stays on corresponding day tile

Additional information

screen recording: https://github.com/user-attachments/assets/d83076fa-a51a-47ce-9304-af446d6581d8

Environment

  • Browser (if applicable): Chrome 126.0.6478.183
  • React-Calendar version: 5.0.0
  • React version: 18.0.0

lemontini avatar Jul 23 '24 08:07 lemontini