Skip to content

Commit bd0eb61

Browse files
committed
autoOk added to docs, missing comma, const
1 parent d0ed1db commit bd0eb61

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

docs/src/app/components/pages/components/time-picker.jsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ let TimePickerPage = React.createClass({
1313
{
1414
name: 'Props',
1515
infoArray: [
16+
{
17+
name: 'autoOk',
18+
type: 'boolean',
19+
header: 'default: false',
20+
desc: 'If true, automatically accept and close the picker on set minutes.',
21+
},
1622
{
1723
name: 'defaultTime',
1824
type: 'date object',
@@ -113,6 +119,12 @@ let TimePickerPage = React.createClass({
113119
format="24hr"
114120
hintText="24hr Format"
115121
onChange={this._changeTimePicker12} />
122+
123+
<TimePicker
124+
ref="pickerAutoOk"
125+
format="24hr"
126+
hintText="AutoOk"
127+
autoOk={true} />
116128
</CodeExample>
117129
</ComponentDoc>
118130
);

docs/src/app/components/raw-code/time-picker-code.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,8 @@
77
<TimePicker
88
format="24hr"
99
hintText="24hr Format" />
10+
11+
//Auto OK
12+
<TimePicker
13+
hintText="AutoOk"
14+
autoOk={true} />

src/time-picker/clock.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ const Clock = React.createClass({
174174

175175
const { onChangeMinutes } = this.props;
176176
if (typeof(onChangeMinutes) === 'function') {
177-
onChangeMinutes(time);
177+
setTimeout(() => { onChangeMinutes(time); }, 0);
178178
}
179179
},
180180

src/time-picker/time-picker-dialog.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ const TimePickerDialog = React.createClass({
9292
onTouchTap={this._handleOKTouchTap} />,
9393
];
9494

95-
let onClockChangeMinutes = (autoOk === true ? this._handleOKTouchTap : undefined);
95+
const onClockChangeMinutes = (autoOk === true ? this._handleOKTouchTap : undefined);
9696

9797
return (
9898
<Dialog {...other}

0 commit comments

Comments
 (0)