File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
components/SLDSNotification Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ class SLDSNotification extends React.Component {
62
62
if ( nextProps . isOpen && ! this . state . interval ) {
63
63
this . setState ( { interval : setTimeout ( ( ) => {
64
64
this . setState ( { revealForScreenreader : ! this . state . revealForScreenreader } ) ;
65
+ console . log ( 'the isOpen state inside is' , this . state . isOpen ) ;
65
66
} , 500 ) } )
66
67
}
67
68
}
Original file line number Diff line number Diff line change @@ -74,11 +74,12 @@ module.exports = React.createClass( {
74
74
} ,
75
75
76
76
dismissToast ( ) {
77
+ this . setState ( { alertIsOpen : false } ) ;
77
78
console . log ( '====> Dismiss Toast Message' ) ;
78
79
} ,
79
80
80
- toggleAlert ( ) {
81
- this . setState ( { alertIsOpen : ! this . state . alertIsOpen } ) ;
81
+ openAlert ( ) {
82
+ this . setState ( { alertIsOpen : true } ) ;
82
83
} ,
83
84
84
85
render ( ) {
@@ -108,7 +109,7 @@ module.exports = React.createClass( {
108
109
< div className = 'slds-p-vertical--medium' >
109
110
< div className = "slds-p-vertical--small" >
110
111
< h4 className = "slds-text-heading--small " > Alerts</ h4 >
111
- < SLDSButton variant = "neutral" label = "Show Alert" onClick = { this . toggleAlert } />
112
+ < SLDSButton variant = "neutral" label = "Show Alert" onClick = { this . openAlert } />
112
113
< SLDSNotification variant = 'alert' theme = 'success' icon = 'notification' isOpen = { this . state . alertIsOpen } texture = { true } content = { successMsg } onDismiss = { this . dismissToast } />
113
114
</ div >
114
115
You can’t perform that action at this time.
0 commit comments