Skip to content

Commit

Permalink
added openDialog() and focus() to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tyfoo committed Oct 22, 2015
1 parent 2a4ce1f commit 77f71aa
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/src/app/components/pages/components/time-picker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,18 @@ let TimePickerPage = React.createClass({
header: 'TimePicker.formatTime(time)',
desc: 'Formats the Date object to a current component\'s time format.',
},
{
name: 'openDialog',
header: 'TimePicker.openDialog()',
desc: 'Opens the time-picker dialog programmatically. Use this if you want to open the ' +
'dialog in response to some event other than focus/tap on the input field, such as an ' +
'external button click.',
},
{
name: 'focus',
header: 'TimePicker.focus()',
desc: 'An alias for the `openDialog()` method to allow more generic use alongside `TextField`.',
},
],
},
{
Expand Down
7 changes: 7 additions & 0 deletions src/time-picker/time-picker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ const TimePicker = React.createClass({
this.refs.input.setValue(this.formatTime(t));
},

/**
* Alias for `openDialog()` for an api consistent with TextField.
*/
focus() {
this.openDialog();
},

openDialog() {
this.setState({
dialogTime: this.getTime(),
Expand Down

0 comments on commit 77f71aa

Please sign in to comment.