Skip to content

Commit

Permalink
Merge pull request #3799 from yuki0410-dev/feature/fix_#3779
Browse files Browse the repository at this point in the history
fix openToDate causes month shifting (#3779)
  • Loading branch information
martijnrusschen committed Jan 30, 2023
2 parents 3070e4a + 321084a commit 3ed38ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/calendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,8 @@ export default class Calendar extends React.Component {
componentDidUpdate(prevProps) {
if (
this.props.preSelection &&
!isSameDay(this.props.preSelection, prevProps.preSelection)
(!isSameDay(this.props.preSelection, prevProps.preSelection) ||
this.props.monthSelectedIn !== prevProps.monthSelectedIn)
) {
this.setState({
date: this.props.preSelection,
Expand Down

0 comments on commit 3ed38ac

Please sign in to comment.