diff --git a/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts b/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts index db8520cc62..efe6f3e48a 100644 --- a/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts +++ b/api/js/etemplate/Et2InputWidget/Et2InputWidget.ts @@ -222,7 +222,7 @@ const Et2InputWidgetMixin = >(superclass : T) if(changedProperties.has('required')) { // Remove all existing Required validators (avoids duplicates) - this.validators = (this.validators || []).filter((validator) => validator instanceof Required) + this.validators = (this.validators || []).filter((validator) => !(validator instanceof Required)) if(this.required) { this.validators.push(new Required()); diff --git a/api/js/etemplate/Et2Textbox/Et2Textbox.ts b/api/js/etemplate/Et2Textbox/Et2Textbox.ts index 1b2d6cefed..f21aa390d5 100644 --- a/api/js/etemplate/Et2Textbox/Et2Textbox.ts +++ b/api/js/etemplate/Et2Textbox/Et2Textbox.ts @@ -76,7 +76,7 @@ export class Et2Textbox extends Et2InputWidget(SlInput) if(changedProperties.has('validator')) { // Remove all existing Pattern validators (avoids duplicates) - this.validators = (this.validators || []).filter((validator) => validator instanceof Regex) + this.validators = (this.validators || []).filter((validator) => !(validator instanceof Regex)) this.validators.push(new Regex(this.validator)); } }