From d960cb91cbe59907f0a6df37e705f9d9418824aa Mon Sep 17 00:00:00 2001 From: Olivier Tassinari Date: Mon, 30 Dec 2019 11:17:06 +0100 Subject: [PATCH] move snackbar changes to another pull request --- docs/pages/api/snackbar.md | 2 +- .../snackbars/ConsecutiveSnackbars.js | 5 ++++- .../snackbars/ConsecutiveSnackbars.tsx | 5 ++++- .../components/snackbars/DirectionSnackbar.js | 5 ++++- .../snackbars/DirectionSnackbar.tsx | 5 ++++- .../snackbars/FabIntegrationSnackbar.js | 7 +++++-- .../snackbars/FabIntegrationSnackbar.tsx | 7 +++++-- .../snackbars/PositionedSnackbar.js | 5 ++++- .../snackbars/PositionedSnackbar.tsx | 5 ++++- .../components/snackbars/SimpleSnackbar.js | 5 ++++- .../components/snackbars/SimpleSnackbar.tsx | 5 ++++- .../snackbars/TransitionsSnackbar.js | 5 ++++- .../snackbars/TransitionsSnackbar.tsx | 5 ++++- .../pages/components/snackbars/snackbars.md | 21 ++++++++++++------- .../onepirate/modules/components/Snackbar.js | 5 +++-- packages/material-ui/src/Snackbar/Snackbar.js | 2 +- .../test/typescript/components.spec.tsx | 2 +- 17 files changed, 70 insertions(+), 26 deletions(-) diff --git a/docs/pages/api/snackbar.md b/docs/pages/api/snackbar.md index 3ecebff33c2c56..4384127502c3da 100644 --- a/docs/pages/api/snackbar.md +++ b/docs/pages/api/snackbar.md @@ -26,7 +26,7 @@ You can learn more about the difference by [reading this guide](/guides/minimizi |:-----|:-----|:--------|:------------| | action | node | | The action to display. | | anchorOrigin | { horizontal: 'left'
| 'center'
| 'right', vertical: 'top'
| 'bottom' }
| { vertical: 'bottom', horizontal: 'center' } | The anchor of the `Snackbar`. | -| autoHideDuration | number | null | The number of milliseconds to wait before automatically calling the `onClose` function. `onClose` should then set the state of the `open` prop to hide the Snackbar. This behavior is disabled by default with the `null` value. | +| autoHideDuration | number | | The number of milliseconds to wait before automatically calling the `onClose` function. `onClose` should then set the state of the `open` prop to hide the Snackbar. This behavior is disabled by default with the `null` value. | | children | element | | Replace the `SnackbarContent` component. | | classes | object | | Override or extend the styles applied to the component. See [CSS API](#css) below for more details. | | ClickAwayListenerProps | object | | Props applied to the `ClickAwayListener` element. | diff --git a/docs/src/pages/components/snackbars/ConsecutiveSnackbars.js b/docs/src/pages/components/snackbars/ConsecutiveSnackbars.js index d31b40acad3da1..eee3ff37af5a6d 100644 --- a/docs/src/pages/components/snackbars/ConsecutiveSnackbars.js +++ b/docs/src/pages/components/snackbars/ConsecutiveSnackbars.js @@ -64,7 +64,10 @@ export default function ConsecutiveSnackbars() { autoHideDuration={6000} onClose={handleClose} onExited={handleExited} - message={messageInfo ? messageInfo.message : undefined} + ContentProps={{ + 'aria-describedby': 'message-id', + }} + message={{messageInfo ? messageInfo.message : undefined}} action={[ } + message={Archived} + action={ + + } /> ``` diff --git a/docs/src/pages/premium-themes/onepirate/modules/components/Snackbar.js b/docs/src/pages/premium-themes/onepirate/modules/components/Snackbar.js index 2b27d57d774089..c2a20ec476137c 100644 --- a/docs/src/pages/premium-themes/onepirate/modules/components/Snackbar.js +++ b/docs/src/pages/premium-themes/onepirate/modules/components/Snackbar.js @@ -46,9 +46,10 @@ function Snackbar(props) { return ( - {message} + {message} } action={[ diff --git a/packages/material-ui/src/Snackbar/Snackbar.js b/packages/material-ui/src/Snackbar/Snackbar.js index 6202fd8e3afb82..100f8e62218e6a 100644 --- a/packages/material-ui/src/Snackbar/Snackbar.js +++ b/packages/material-ui/src/Snackbar/Snackbar.js @@ -99,7 +99,7 @@ const Snackbar = React.forwardRef(function Snackbar(props, ref) { const { action, anchorOrigin: { vertical, horizontal } = { vertical: 'bottom', horizontal: 'center' }, - autoHideDuration = null, + autoHideDuration, children, classes, className, diff --git a/packages/material-ui/test/typescript/components.spec.tsx b/packages/material-ui/test/typescript/components.spec.tsx index 91f6b2ee98f2dc..5b8bd0bc522d45 100644 --- a/packages/material-ui/test/typescript/components.spec.tsx +++ b/packages/material-ui/test/typescript/components.spec.tsx @@ -716,7 +716,7 @@ const SnackbarTest = () => ( horizontal: 'left', }} open={true} - autoHideDuration={6000} + autoHideDuration={6e3} onClose={e => log(e)} ContentProps={ {