Skip to content

Commit 77f71aa

Browse files
committed
added openDialog() and focus() to docs
1 parent 2a4ce1f commit 77f71aa

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
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
@@ -63,6 +63,18 @@ let TimePickerPage = React.createClass({
6363
header: 'TimePicker.formatTime(time)',
6464
desc: 'Formats the Date object to a current component\'s time format.',
6565
},
66+
{
67+
name: 'openDialog',
68+
header: 'TimePicker.openDialog()',
69+
desc: 'Opens the time-picker dialog programmatically. Use this if you want to open the ' +
70+
'dialog in response to some event other than focus/tap on the input field, such as an ' +
71+
'external button click.',
72+
},
73+
{
74+
name: 'focus',
75+
header: 'TimePicker.focus()',
76+
desc: 'An alias for the `openDialog()` method to allow more generic use alongside `TextField`.',
77+
},
6678
],
6779
},
6880
{

src/time-picker/time-picker.jsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,13 @@ const TimePicker = React.createClass({
120120
this.refs.input.setValue(this.formatTime(t));
121121
},
122122

123+
/**
124+
* Alias for `openDialog()` for an api consistent with TextField.
125+
*/
126+
focus() {
127+
this.openDialog();
128+
},
129+
123130
openDialog() {
124131
this.setState({
125132
dialogTime: this.getTime(),

0 commit comments

Comments
 (0)