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 {
6262 if ( nextProps . isOpen && ! this . state . interval ) {
6363 this . setState ( { interval : setTimeout ( ( ) => {
6464 this . setState ( { revealForScreenreader : ! this . state . revealForScreenreader } ) ;
65+ console . log ( 'the isOpen state inside is' , this . state . isOpen ) ;
6566 } , 500 ) } )
6667 }
6768 }
Original file line number Diff line number Diff line change @@ -74,11 +74,12 @@ module.exports = React.createClass( {
7474 } ,
7575
7676 dismissToast ( ) {
77+ this . setState ( { alertIsOpen : false } ) ;
7778 console . log ( '====> Dismiss Toast Message' ) ;
7879 } ,
7980
80- toggleAlert ( ) {
81- this . setState ( { alertIsOpen : ! this . state . alertIsOpen } ) ;
81+ openAlert ( ) {
82+ this . setState ( { alertIsOpen : true } ) ;
8283 } ,
8384
8485 render ( ) {
@@ -108,7 +109,7 @@ module.exports = React.createClass( {
108109 < div className = 'slds-p-vertical--medium' >
109110 < div className = "slds-p-vertical--small" >
110111 < 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 } />
112113 < SLDSNotification variant = 'alert' theme = 'success' icon = 'notification' isOpen = { this . state . alertIsOpen } texture = { true } content = { successMsg } onDismiss = { this . dismissToast } />
113114 </ div >
114115
You can’t perform that action at this time.
0 commit comments