Use milliseconds for timeout.

old
@soyjavi 2015-11-21 11:24:14 +07:00
parent 0d5310d0ec
commit 7fc2617fa9
3 changed files with 3 additions and 3 deletions

View File

@ -21,7 +21,7 @@ class Snackbar extends React.Component {
if (this.props.active && this.props.timeout) {
setTimeout(() => {
this.props.onTimeout(event, this);
}, this.props.timeout * 1000);
}, this.props.timeout);
}
}

View File

@ -44,5 +44,5 @@ class SnackbarTest extends React.Component {
| `label` | `String` | | Text to display in the content.|
| `onClick` | `Function` | | Callback function that will be called when the button action is clicked.|
| `onTimeout` | `Function` | | Callback function when finish the set timeout.|
| `timeout` | `Number` | | Amount of time after the Snackbar will be automatically hidden.|
| `timeout` | `Number` | | Amount of time in milliseconds after the Snackbar will be automatically hidden.|
| `type` | `String` | | Indicates the action type. Can be `accept`, `warning` or `cancel`|

View File

@ -26,7 +26,7 @@ class SnackbarTest extends React.Component {
active={this.state.active}
icon='question-answer'
label='Snackbar action cancel'
timeout={2}
timeout={2000}
onClick={this.handleSnackbarClick}
onTimeout={this.handleSnackbarTimeout}
type='cancel'