Skip to content

Selected date does not update properly when transformed somehow outside React-Calendar #29

@wojtekmaj

Description

@wojtekmaj

There is a specific case explained in #27 which causes React-Calendar to misbehave. If the date returned in onChange callback is not what ends up in value prop (e.g. is expanded to a full week like described), React-Calendar will fail to update the value for the second time if the same date is clicked.

This is caused by React-Calendar:

  • Assuming the value in props is the same as in state, and comparing values of old and new props in componentWillReceiveProps
  • Calling onChange before React-Calendar updates itself

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions