Add optional cancel handler in dialog dismiss
parent
c7ef9ea772
commit
c2da4d8547
|
@ -34,6 +34,7 @@ const factory = (Input, DatePickerDialog) => {
|
|||
name: PropTypes.string,
|
||||
onChange: PropTypes.func,
|
||||
onClick: PropTypes.func,
|
||||
onDismiss: PropTypes.func,
|
||||
onEscKeyDown: PropTypes.func,
|
||||
onKeyPress: PropTypes.func,
|
||||
onOverlayClick: PropTypes.func,
|
||||
|
@ -101,7 +102,7 @@ const factory = (Input, DatePickerDialog) => {
|
|||
const { active, // eslint-disable-line
|
||||
autoOk, inputClassName, inputFormat, locale, maxDate, minDate,
|
||||
onEscKeyDown, onOverlayClick, readonly, sundayFirstDayOfWeek, value,
|
||||
...others } = this.props;
|
||||
onDismiss, ...others } = this.props;
|
||||
const finalInputFormat = inputFormat || time.formatDate;
|
||||
const date = Object.prototype.toString.call(value) === '[object Date]' ? value : undefined;
|
||||
const formattedDate = date === undefined ? '' : finalInputFormat(value, locale);
|
||||
|
@ -131,7 +132,7 @@ const factory = (Input, DatePickerDialog) => {
|
|||
maxDate={maxDate}
|
||||
minDate={minDate}
|
||||
name={this.props.name}
|
||||
onDismiss={this.handleDismiss}
|
||||
onDismiss={onDismiss || this.handleDismiss}
|
||||
onEscKeyDown={onEscKeyDown || this.handleDismiss}
|
||||
onOverlayClick={onOverlayClick || this.handleDismiss}
|
||||
onSelect={this.handleSelect}
|
||||
|
|
Loading…
Reference in New Issue