if value is set from outside mark as not required

This commit is contained in:
dcore94 2023-10-03 16:18:48 +02:00
parent 0f7bbacce3
commit 650cc75df0
1 changed files with 1 additions and 1 deletions

View File

@ -402,7 +402,7 @@ class CCPFileInputWidgetController extends CCPBaseInputWidgetController{
if(this.value.length <= 1){
const v = this.value.length ? this.value[0] : ''
return `
<input type="file" data-index="0" class="my-2 form-control" placeholder="${this.title}" name="${this.name}" ${this.readonly ? 'readonly' : ''} ${this.required ? 'required' : ''} value="${v}"/>
<input type="file" data-index="0" class="my-2 form-control" placeholder="${this.title}" name="${this.name}" ${this.readonly ? 'readonly' : ''} ${this.required && !v ? 'required' : ''} value="${v}"/>
<small name ="preview" class="form-text text-muted">${v.substr(0,5) + "..." + v.substr(v.length-5)}</small>
`
}