From 08a1ab07d8695dee2838ca8823ab886ca908d29e Mon Sep 17 00:00:00 2001 From: Fadi Khadra Date: Tue, 23 Jan 2018 22:15:24 +0100 Subject: [PATCH] =?UTF-8?q?Add=20accessibility=20=F0=9F=8D=BE=20realte=20t?= =?UTF-8?q?o=20issue=20#121?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/DefaultTransition.js | 1 - src/Toast.js | 10 +++++++--- src/__tests__/__snapshots__/Toast.js.snap | 1 + 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/DefaultTransition.js b/src/DefaultTransition.js index e8f12825..fdfb2690 100644 --- a/src/DefaultTransition.js +++ b/src/DefaultTransition.js @@ -33,7 +33,6 @@ function DefaultTransition({ children, position, ...props }) { {...props} timeout={750} onEnter={node => node.classList.add(enter)} - onEntered={node => node.classList.remove(enter)} onExit={node => node.classList.add(exit)} > {children} diff --git a/src/Toast.js b/src/Toast.js index 5b13e77c..d8a727fc 100644 --- a/src/Toast.js +++ b/src/Toast.js @@ -63,7 +63,8 @@ class Toast extends Component { PropTypes.string, PropTypes.object ]), - updateId: PropTypes.number + updateId: PropTypes.number, + ariaLabel: PropTypes.string }; static defaultProps = { @@ -75,7 +76,8 @@ class Toast extends Component { className: '', bodyClassName: '', progressClassName: '', - updateId: null + updateId: null, + role: 'alert' }; state = { @@ -138,7 +140,8 @@ class Toast extends Component { className, bodyClassName, progressClassName, - updateId + updateId, + role } = this.props; return ( @@ -156,6 +159,7 @@ class Toast extends Component { {...this.getToastProps()} >
FooBar