mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-26 16:48:49 +01:00
Fix general free entries did not validate with 0 validators
This commit is contained in:
parent
00b5cd0cd2
commit
2e319319d1
@ -874,7 +874,7 @@ export const Et2WithSearchMixin = <T extends Constructor<LitElement>>(superclass
|
||||
return false;
|
||||
}
|
||||
// Make sure not to double-add
|
||||
if(!this.select_options.find(o => o.value == text))
|
||||
if(!this.select_options.find(o => o.value == text) && !this.__select_options.find(o => o.value == text))
|
||||
{
|
||||
this.__select_options.push(<SelectOption>{
|
||||
value: text,
|
||||
@ -891,7 +891,6 @@ export const Et2WithSearchMixin = <T extends Constructor<LitElement>>(superclass
|
||||
else if(!this.multiple && this.value !== text)
|
||||
{
|
||||
this.value = text;
|
||||
return;
|
||||
}
|
||||
|
||||
// Once added to options, add to value / tags
|
||||
@ -915,7 +914,7 @@ export const Et2WithSearchMixin = <T extends Constructor<LitElement>>(superclass
|
||||
let result = validators.filter(v =>
|
||||
v.execute(text, v.param, {node: this}),
|
||||
);
|
||||
return result.length == 0;
|
||||
return validators.length > 0 && result.length == 0 || validators.length == 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user