Cannot read properties of null (reading 'parentElement') causes by custimisation recurrenceEditor.frequencies - Branched from 180833

Also for you convenience .

From developer tools:

Uncaught TypeError: Cannot read properties of null (reading 'parentElement')

at FormValidator.getErrorElement (form-validator.js?68c5:679:34)

at FormValidator.validateRules (form-validator.js?68c5:546:1)

at FormValidator.validate (form-validator.js?68c5:201:1)

at EventWindow.eventSave (event-window.js?b7e0:1170:1)


From form-validator.js file

line 677

// Get error element by name

FormValidator.prototype.getErrorElement = function (name) {

// line bellow

this.infoElement = select(this.errorElement + '.' + this.errorClass, this.inputElement.parentElement);

if (!this.infoElement) {

this.infoElement = select(this.errorElement + '.' + this.errorClass + '[for="' + name + '"]', this.element);

}

return this.infoElement;

};


--------------------------------------------------------------------------


I had similar issue in treegrid component in edit template,

it solved by adding id="field_name" to edit template elements.

then in the action complete you will have changed data under args.data


3 Replies

SK Sreedhar Kumar Panarapu Sreenivasulu Panarapu Syncfusion Team July 7, 2025 01:02 PM UTC

Hi Sinisa,

Thank you for the update.

We reviewed the details, and the error appears to stem from a null parentElement reference during validation.

To guard against this, you can update the getErrorElement function in the FormValidator as follows:

FormValidator.prototype.getErrorElement = function (name) {  

  if (!this.inputElement || !this.inputElement.parentElement) {        console.warn('inputElement or parentElement is null for', name);

       return null;  

  }  

  this.infoElement = select(this.errorElement + '.' + this.errorClass, this.inputElement.parentElement);

   if (!this.infoElement) {

        this.infoElement = select(this.errorElement + '.' + this.errorClass + '[for="' + name + '"]', this.element);  

 }

   return this.infoElement;

};

This conditional check ensures that validation logic won’t break when parentElement is unavailable—especially useful when working with dynamically rendered templates.

If the issue still persists, please share a simplified, reproducible sample so we can investigate further and provide a more targeted solution.

Best regards,

Sreedhar Kumar



SI Sinisa August 21, 2025 02:51 AM UTC

OK thanks, but where to update this ? 

I'm not sure where to put this line of code.


And of corse  this error comes when I heavy customise popUpFunction ( Editor ) inside of Scheduler component


Cheers,

Sinisa



SK Sreedhar Kumar Panarapu Sreenivasulu Panarapu Syncfusion Team August 21, 2025 02:44 PM UTC

Hi Sinisa,

We have branched this query with the respective Scheduler team

Regards,

Sreedhar Kumar. 


Loader.
Up arrow icon