diff --git a/docs/src/app/components/pages/components/time-picker.jsx b/docs/src/app/components/pages/components/time-picker.jsx index acb7029479cb3f..e673af5c3874da 100644 --- a/docs/src/app/components/pages/components/time-picker.jsx +++ b/docs/src/app/components/pages/components/time-picker.jsx @@ -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`.', + }, ], }, { @@ -91,7 +103,7 @@ let TimePickerPage = React.createClass({ { name: 'onShow', header: 'function()', - desc: 'Fired when the timepicker dialog is shown.', + desc: 'Fired when the timepicker dialog is dismissed.', }, ], }, diff --git a/src/time-picker/time-picker.jsx b/src/time-picker/time-picker.jsx index d6e4c6d210bd78..6b7a0ff83ce97d 100644 --- a/src/time-picker/time-picker.jsx +++ b/src/time-picker/time-picker.jsx @@ -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(),