Skip to content

Commit

Permalink
Merge pull request #768 from myronliu347/master
Browse files Browse the repository at this point in the history
Fix DatePicker & CascaderSelect Bug
  • Loading branch information
youluna authored Jun 5, 2019
2 parents 40de21d + 2ea6cf6 commit 26f73a3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/calendar/range-calendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,10 @@ class RangeCalendar extends React.Component {
startValue,
});

if (startValue) {
if (
startValue &&
!startValue.isSame(this.state.startValue, 'day')
) {
this.setState({
startVisibleMonth: startValue,
});
Expand All @@ -156,7 +159,7 @@ class RangeCalendar extends React.Component {
}

onSelectCell = (date, nextMode) => {
this.changeVisibleMonth(date, 'cellClick');
// this.changeVisibleMonth(date, 'cellClick');

if (this.state.mode === CALENDAR_MODE_DATE) {
this.props.onSelect(date);
Expand Down
6 changes: 5 additions & 1 deletion src/cascader-select/cascader-select.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,10 @@ export default class CascaderSelect extends Component {
if (onChange) {
onChange(value, data, extra);
}

if (searchValue && this.select) {
this.select.handleSearchClear();
}
}

handleClear() {
Expand Down Expand Up @@ -826,7 +830,7 @@ export default class CascaderSelect extends Component {
visible,
onVisibleChange: this.handleVisibleChange,
showSearch,
searchValue,
// searchValue,
onSearch: this.handleSearch,
onKeyDown: this.handleKeyDown,
popupContent,
Expand Down
2 changes: 1 addition & 1 deletion src/select/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,5 @@ Select.Combobox = ConfigProvider.config(Select, {

export default ConfigProvider.config(Select, {
transform,
exportNames: ['focusInput'],
exportNames: ['focusInput', 'handleSearchClear'],
});

0 comments on commit 26f73a3

Please sign in to comment.