Fix datepicker in advanced filter (https://github.com/woocommerce/woocommerce-admin/pull/7982)
* Make sure we set the onMonthPreviewed prop as this is required for wp.components.DatePicker * Add changelogs
This commit is contained in:
parent
0cb4382c05
commit
7eeb77acc3
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: Fix
|
||||||
|
|
||||||
|
Fix usage of Wordpress DatePicker component. #7982
|
|
@ -1,5 +1,7 @@
|
||||||
# Unreleased
|
# Unreleased
|
||||||
|
|
||||||
|
- Fix usage of Wordpress DatePicker component in `DatePicker`. #7982
|
||||||
|
|
||||||
# 8.1.1
|
# 8.1.1
|
||||||
|
|
||||||
- Fixed warnings when using AdvancedFilters component. #7704
|
- Fixed warnings when using AdvancedFilters component. #7704
|
||||||
|
|
|
@ -6,7 +6,7 @@ import 'core-js/features/array/from';
|
||||||
import { __, sprintf } from '@wordpress/i18n';
|
import { __, sprintf } from '@wordpress/i18n';
|
||||||
import { createElement, Component } from '@wordpress/element';
|
import { createElement, Component } from '@wordpress/element';
|
||||||
import { Dropdown, DatePicker as WpDatePicker } from '@wordpress/components';
|
import { Dropdown, DatePicker as WpDatePicker } from '@wordpress/components';
|
||||||
import { partial } from 'lodash';
|
import { partial, noop } from 'lodash';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { dateValidationMessages, toMoment } from '@woocommerce/date';
|
import { dateValidationMessages, toMoment } from '@woocommerce/date';
|
||||||
|
@ -127,6 +127,8 @@ class DatePicker extends Component {
|
||||||
this.onDateChange,
|
this.onDateChange,
|
||||||
onToggle
|
onToggle
|
||||||
) }
|
) }
|
||||||
|
// onMonthPreviewed is required to prevent a React error from happening.
|
||||||
|
onMonthPreviewed={ noop }
|
||||||
isInvalidDate={ isInvalidDate }
|
isInvalidDate={ isInvalidDate }
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue