diff --git a/components/date-picker/RangePicker.tsx b/components/date-picker/RangePicker.tsx index b86edd6243..e28fe54376 100644 --- a/components/date-picker/RangePicker.tsx +++ b/components/date-picker/RangePicker.tsx @@ -3,6 +3,7 @@ import GregorianCalendar from 'gregorian-calendar'; import RangeCalendar from 'rc-calendar/lib/RangeCalendar'; import RcDatePicker from 'rc-calendar/lib/Picker'; import classNames from 'classnames'; +import Icon from '../icon'; export default class RangePicker extends React.Component { static defaultProps = { @@ -33,6 +34,13 @@ export default class RangePicker extends React.Component { } } + clearSelection = (e) => { + e.preventDefault(); + e.stopPropagation(); + this.setState({ value: [] }); + this.handleChange([]); + } + handleChange = (value) => { const props = this.props; if (!('value' in props)) { @@ -100,6 +108,13 @@ export default class RangePicker extends React.Component { /> ); + const clearIcon = (!props.disabled && state.value && (state.value[0] || state.value[1])) + ? : null; + return ( + {clearIcon} ); diff --git a/components/form/index.tsx b/components/form/index.tsx index e46172b297..42388f9c74 100644 --- a/components/form/index.tsx +++ b/components/form/index.tsx @@ -4,6 +4,7 @@ import ValueMixin from './ValueMixin'; import createDOMForm from 'rc-form/lib/createDOMForm'; import assign from 'object-assign'; import { FIELD_META_PROP } from './constants'; + Form.create = (o = {}) => { const options = assign({}, o, { fieldNameProp: 'id', diff --git a/components/steps/index.tsx b/components/steps/index.tsx index 3440931f2e..2804c40fea 100644 --- a/components/steps/index.tsx +++ b/components/steps/index.tsx @@ -7,17 +7,12 @@ export default class Steps extends React.Component { static defaultProps = { prefixCls: 'ant-steps', iconPrefix: 'ant', - maxDescriptionWidth: 100, current: 0, } render() { - let maxDescriptionWidth = this.props.maxDescriptionWidth; - if (this.props.direction === 'vertical') { - maxDescriptionWidth = 'auto'; - } return ( - + ); } }