Skip to content

Commit

Permalink
fix(Calendar): select month auto change date view
Browse files Browse the repository at this point in the history
  • Loading branch information
myronliu347 committed May 24, 2019
1 parent 53fe94d commit 354f545
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/calendar/calendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,18 @@ class Calendar extends Component {
}

onSelectCell = (date, nextMode) => {
const { shape } = this.props;

this.changeVisibleMonth(date, 'cellClick');

// 当用户所在的面板为初始化面板时,则选择动作为触发 onSelect 回调
if (this.state.mode === this.MODES[0]) {
this.props.onSelect(date);
}
this.changeMode(nextMode);

if (shape === 'panel') {
this.changeMode(nextMode);
}
};

changeMode = nextMode => {
Expand Down

0 comments on commit 354f545

Please sign in to comment.