From bd0eb612521fe63fec7086abdc17e321682d958e Mon Sep 17 00:00:00 2001 From: Ty Date: Wed, 21 Oct 2015 10:04:35 +0100 Subject: [PATCH] autoOk added to docs, missing comma, const --- .../app/components/pages/components/time-picker.jsx | 12 ++++++++++++ .../src/app/components/raw-code/time-picker-code.txt | 5 +++++ src/time-picker/clock.jsx | 2 +- src/time-picker/time-picker-dialog.jsx | 2 +- 4 files changed, 19 insertions(+), 2 deletions(-) diff --git a/docs/src/app/components/pages/components/time-picker.jsx b/docs/src/app/components/pages/components/time-picker.jsx index d243a7ba9b63e8..588d7c0f710ae8 100644 --- a/docs/src/app/components/pages/components/time-picker.jsx +++ b/docs/src/app/components/pages/components/time-picker.jsx @@ -13,6 +13,12 @@ let TimePickerPage = React.createClass({ { name: 'Props', infoArray: [ + { + name: 'autoOk', + type: 'boolean', + header: 'default: false', + desc: 'If true, automatically accept and close the picker on set minutes.', + }, { name: 'defaultTime', type: 'date object', @@ -113,6 +119,12 @@ let TimePickerPage = React.createClass({ format="24hr" hintText="24hr Format" onChange={this._changeTimePicker12} /> + + ); diff --git a/docs/src/app/components/raw-code/time-picker-code.txt b/docs/src/app/components/raw-code/time-picker-code.txt index dc2a5de060396b..3b99da56d9692a 100644 --- a/docs/src/app/components/raw-code/time-picker-code.txt +++ b/docs/src/app/components/raw-code/time-picker-code.txt @@ -7,3 +7,8 @@ + +//Auto OK + diff --git a/src/time-picker/clock.jsx b/src/time-picker/clock.jsx index 60bfd9d1fafbe3..34430a2306f543 100644 --- a/src/time-picker/clock.jsx +++ b/src/time-picker/clock.jsx @@ -174,7 +174,7 @@ const Clock = React.createClass({ const { onChangeMinutes } = this.props; if (typeof(onChangeMinutes) === 'function') { - onChangeMinutes(time); + setTimeout(() => { onChangeMinutes(time); }, 0); } }, diff --git a/src/time-picker/time-picker-dialog.jsx b/src/time-picker/time-picker-dialog.jsx index b59498dbfcbb52..5c1c33b3bb07a0 100644 --- a/src/time-picker/time-picker-dialog.jsx +++ b/src/time-picker/time-picker-dialog.jsx @@ -92,7 +92,7 @@ const TimePickerDialog = React.createClass({ onTouchTap={this._handleOKTouchTap} />, ]; - let onClockChangeMinutes = (autoOk === true ? this._handleOKTouchTap : undefined); + const onClockChangeMinutes = (autoOk === true ? this._handleOKTouchTap : undefined); return (