Skip to content

Commit 3ed38ac

Browse files
Merge pull request #3799 from yuki0410-dev/feature/fix_#3779
fix openToDate causes month shifting (#3779)
2 parents 3070e4a + 321084a commit 3ed38ac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/calendar.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ export default class Calendar extends React.Component {
230230
componentDidUpdate(prevProps) {
231231
if (
232232
this.props.preSelection &&
233-
!isSameDay(this.props.preSelection, prevProps.preSelection)
233+
(!isSameDay(this.props.preSelection, prevProps.preSelection) ||
234+
this.props.monthSelectedIn !== prevProps.monthSelectedIn)
234235
) {
235236
this.setState({
236237
date: this.props.preSelection,

0 commit comments

Comments
 (0)