@@ -109,9 +109,9 @@ export class AddonModForumPostComponent implements OnInit, OnDestroy, OnChanges
109109 * Detect changes on input properties.
110110 */
111111 ngOnChanges ( changes : { [ name : string ] : SimpleChange } ) : void {
112- if ( changes . leavingPage && this . leavingPage && this . formElement ) {
112+ if ( changes . leavingPage && this . leavingPage ) {
113113 // Download all courses is enabled now, initialize it.
114- this . domUtils . triggerFormCancelledEvent ( this . formElement . nativeElement , this . sitesProvider . getCurrentSiteId ( ) ) ;
114+ this . domUtils . triggerFormCancelledEvent ( this . formElement , this . sitesProvider . getCurrentSiteId ( ) ) ;
115115 }
116116 }
117117
@@ -423,7 +423,7 @@ export class AddonModForumPostComponent implements OnInit, OnDestroy, OnChanges
423423
424424 this . onPostChange . emit ( ) ;
425425
426- this . domUtils . triggerFormSubmittedEvent ( this . formElement . nativeElement , sent , this . sitesProvider . getCurrentSiteId ( ) ) ;
426+ this . domUtils . triggerFormSubmittedEvent ( this . formElement , sent , this . sitesProvider . getCurrentSiteId ( ) ) ;
427427
428428 if ( this . syncId ) {
429429 this . syncProvider . unblockOperation ( AddonModForumProvider . COMPONENT , this . syncId ) ;
@@ -443,7 +443,7 @@ export class AddonModForumPostComponent implements OnInit, OnDestroy, OnChanges
443443 // Reset data.
444444 this . setReplyFormData ( ) ;
445445
446- this . domUtils . triggerFormCancelledEvent ( this . formElement . nativeElement , this . sitesProvider . getCurrentSiteId ( ) ) ;
446+ this . domUtils . triggerFormCancelledEvent ( this . formElement , this . sitesProvider . getCurrentSiteId ( ) ) ;
447447
448448 if ( this . syncId ) {
449449 this . syncProvider . unblockOperation ( AddonModForumProvider . COMPONENT , this . syncId ) ;
0 commit comments