@@ -39,7 +39,7 @@ class SLDSNotification extends React.Component {
39
39
this . state = {
40
40
isOpen : this . props . isOpen ,
41
41
interval : null ,
42
- addSpace : false ,
42
+ revealForScreenreader : false ,
43
43
} ;
44
44
}
45
45
@@ -61,8 +61,8 @@ class SLDSNotification extends React.Component {
61
61
this . setState ( { isOpen : nextProps . isOpen } ) ;
62
62
if ( nextProps . isOpen && ! this . state . interval ) {
63
63
this . setState ( { interval : setTimeout ( ( ) => {
64
- this . setState ( { addSpace : ! this . state . addSpace } ) ;
65
- } , 1000 ) } )
64
+ this . setState ( { revealForScreenreader : ! this . state . revealForScreenreader } ) ;
65
+ } , 500 ) } )
66
66
}
67
67
}
68
68
}
@@ -132,22 +132,31 @@ class SLDSNotification extends React.Component {
132
132
133
133
getClassName ( ) {
134
134
return classNames ( this . props . className , "slds-notify" , {
135
+ [ `slds-transition-hide` ] : ! this . state . revealForScreenreader ,
135
136
[ `slds-notify--${ this . props . variant } ` ] : this . props . variant ,
136
137
[ `slds-theme--${ this . props . theme } ` ] : this . props . theme ,
137
138
[ `slds-theme--alert-texture-animated` ] : this . props . texture ,
138
139
} ) ;
139
140
}
140
141
141
142
renderContent ( ) {
142
- return (
143
- < div >
144
- { this . state . addSpace ? " x" : "" }
143
+ if ( this . state . revealForScreenreader ) {
144
+ return (
145
+ < div >
145
146
< p ref = "test" className = "slds-assistive-text" > { this . props . theme } </ p >
146
147
{ this . renderClose ( ) }
147
148
{ this . renderAlertContent ( ) }
148
149
{ this . renderToastContent ( ) }
149
- </ div >
150
- )
150
+ </ div >
151
+ )
152
+ }
153
+ else {
154
+ return (
155
+ < div className = "slds-hidden" >
156
+ Notification loading
157
+ </ div >
158
+ )
159
+ }
151
160
}
152
161
153
162
render ( ) {
0 commit comments