mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-20 18:08:02 +02:00
Api: Fix client side validation failure when widget value was null
Happens for readonlys, disabled, selects with no valid options
This commit is contained in:
parent
be243c9aa7
commit
47a466a39d
@ -569,11 +569,11 @@ const Et2InputWidgetMixin = <T extends Constructor<LitElement>>(superclass : T)
|
||||
validators.map(async validator =>
|
||||
{
|
||||
let values = this.getValue();
|
||||
if(!Array.isArray(values))
|
||||
if(values !== null && !Array.isArray(values))
|
||||
{
|
||||
values = [values];
|
||||
}
|
||||
if(!values.length)
|
||||
if(values !== null && !values.length)
|
||||
{
|
||||
values = [''];
|
||||
} // so required validation works
|
||||
@ -588,7 +588,7 @@ const Et2InputWidgetMixin = <T extends Constructor<LitElement>>(superclass : T)
|
||||
}
|
||||
// Only validate if field is required, or not required and has a value
|
||||
// Don't bother to validate empty fields
|
||||
else if(this.required || !this.required && this.getValue() != '')
|
||||
else if(this.required || !this.required && this.getValue() != '' && this.getValue() !== null)
|
||||
{
|
||||
// Validate each individual item
|
||||
values.forEach((value) => doCheck(value, validator));
|
||||
|
Loading…
x
Reference in New Issue
Block a user