|
|
@@ -66,7 +66,6 @@ export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGri
|
|
|
startDateOffset: PropTypes.func,
|
|
|
endDateOffset: PropTypes.func,
|
|
|
autoSwitchDate: PropTypes.bool,
|
|
|
- motionEnd: PropTypes.bool,
|
|
|
density: PropTypes.string,
|
|
|
dateFnsLocale: PropTypes.object.isRequired,
|
|
|
timeZone: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
|
|
@@ -169,7 +168,7 @@ export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGri
|
|
|
}
|
|
|
|
|
|
componentDidUpdate(prevProps: MonthsGridProps, prevState: MonthsGridState) {
|
|
|
- const { defaultValue, defaultPickerValue, motionEnd } = this.props;
|
|
|
+ const { defaultValue, defaultPickerValue } = this.props;
|
|
|
if (prevProps.defaultValue !== defaultValue) {
|
|
|
// we should always update panel state when value changes
|
|
|
this.foundation.updateSelectedFromProps(defaultValue);
|
|
|
@@ -179,12 +178,6 @@ export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGri
|
|
|
this.foundation.initDefaultPickerValue();
|
|
|
}
|
|
|
|
|
|
- if (prevProps.motionEnd !== motionEnd && motionEnd === true) {
|
|
|
- if (this.foundation.isRangeType()) {
|
|
|
- const currentPanelHeight = this.calcScrollListHeight();
|
|
|
- this.setState({ currentPanelHeight });
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
const isRange = this.foundation.isRangeType();
|
|
|
if (isRange) {
|
|
|
@@ -240,14 +233,10 @@ export default class MonthsGrid extends BaseComponent<MonthsGridProps, MonthsGri
|
|
|
* Calculate the height of the scrolling list, if the animation is not over, return 0
|
|
|
*/
|
|
|
calcScrollListHeight = () => {
|
|
|
- const { motionEnd } = this.props;
|
|
|
- let wrapLeft, wrapRight, switchLeft, switchRight;
|
|
|
- if (motionEnd) {
|
|
|
- wrapLeft = this.adapter.getCache(`wrap-${strings.PANEL_TYPE_LEFT}`);
|
|
|
- wrapRight = this.adapter.getCache(`wrap-${strings.PANEL_TYPE_RIGHT}`);
|
|
|
- switchLeft = this.adapter.getCache(`switch-${strings.PANEL_TYPE_LEFT}`);
|
|
|
- switchRight = this.adapter.getCache(`switch-${strings.PANEL_TYPE_RIGHT}`);
|
|
|
- }
|
|
|
+ const wrapLeft = this.adapter.getCache(`wrap-${strings.PANEL_TYPE_LEFT}`);
|
|
|
+ const wrapRight = this.adapter.getCache(`wrap-${strings.PANEL_TYPE_RIGHT}`);
|
|
|
+ const switchLeft = this.adapter.getCache(`switch-${strings.PANEL_TYPE_LEFT}`);
|
|
|
+ const switchRight = this.adapter.getCache(`switch-${strings.PANEL_TYPE_RIGHT}`);
|
|
|
|
|
|
const leftRect = wrapLeft && wrapLeft.getBoundingClientRect();
|
|
|
const rightRect = wrapRight && wrapRight.getBoundingClientRect();
|