diff --git a/static/src/js/components/Datepicker/Datepicker.jsx b/static/src/js/components/Datepicker/Datepicker.jsx index 7ca976b89f..116aad878e 100644 --- a/static/src/js/components/Datepicker/Datepicker.jsx +++ b/static/src/js/components/Datepicker/Datepicker.jsx @@ -28,7 +28,10 @@ class Datepicker extends PureComponent { } componentDidMount() { - const { onTodayClick, onClearClick } = this.props + const { + onTodayClick, + onClearClick + } = this.props // Add a custom set of "Today" and "Clear" buttons and insert them into the picker const container = this.containerRef.current?.querySelector('.rdtPicker') @@ -63,7 +66,10 @@ class Datepicker extends PureComponent { } componentDidUpdate(prevProps) { - const { viewMode, picker } = this.props + const { + viewMode, + picker + } = this.props // If the viewMode has changed, navigate to the new viewMode if (prevProps.viewMode !== viewMode) { @@ -71,12 +77,6 @@ class Datepicker extends PureComponent { } } - componentWillUnmount() { - if (this.updateTimeout) { - clearTimeout(this.updateTimeout) - } - } - onInputChange = (event) => { const caret = event.target.selectionStart const element = event.target diff --git a/static/src/js/components/TemporalSelection/__tests__/TemporalSelection.test.js b/static/src/js/components/TemporalSelection/__tests__/TemporalSelection.test.js index 28433f7a16..24db0ba1d2 100644 --- a/static/src/js/components/TemporalSelection/__tests__/TemporalSelection.test.js +++ b/static/src/js/components/TemporalSelection/__tests__/TemporalSelection.test.js @@ -192,6 +192,7 @@ describe('TemporalSelection component', () => { // Verify onChangeRecurring was called only once with the new range expect(props.onChangeRecurring).toHaveBeenCalledTimes(1) + expect(props.setFieldValue).toHaveBeenCalledTimes(2) expect(props.onChangeRecurring).toHaveBeenCalledWith({ min: 2018, max: 2021