Max 1 file on single attachment
This commit is contained in:
parent
ed228a2288
commit
6d5c47e0cc
|
@ -20,6 +20,8 @@
|
||||||
$: isSingle = schema?.type === FieldType.ATTACHMENT_SINGLE
|
$: isSingle = schema?.type === FieldType.ATTACHMENT_SINGLE
|
||||||
$: arrayValue = (value && !Array.isArray(value) ? [value] : value) || []
|
$: arrayValue = (value && !Array.isArray(value) ? [value] : value) || []
|
||||||
|
|
||||||
|
$: maximum = isSingle ? 1 : schema.constraints?.length?.maximum
|
||||||
|
|
||||||
$: editable = focused && !readonly
|
$: editable = focused && !readonly
|
||||||
$: {
|
$: {
|
||||||
if (!focused) {
|
if (!focused) {
|
||||||
|
@ -111,7 +113,7 @@
|
||||||
value={arrayValue}
|
value={arrayValue}
|
||||||
compact
|
compact
|
||||||
on:change={onFileChange}
|
on:change={onFileChange}
|
||||||
maximum={schema.constraints?.length?.maximum}
|
{maximum}
|
||||||
{processFiles}
|
{processFiles}
|
||||||
{deleteAttachments}
|
{deleteAttachments}
|
||||||
{handleFileTooLarge}
|
{handleFileTooLarge}
|
||||||
|
|
Loading…
Reference in New Issue