Use milliseconds for timeout.
parent
0d5310d0ec
commit
7fc2617fa9
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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`|
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in New Issue