mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
Fix required validator went missing if a regex validator was added
This commit is contained in:
parent
09c219679a
commit
b703e2bfe5
@ -222,7 +222,7 @@ const Et2InputWidgetMixin = <T extends Constructor<LitElement>>(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());
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user