Max 1 file on single attachment

This commit is contained in:
Adria Navarro 2024-03-26 11:45:47 +01:00
parent ed228a2288
commit 6d5c47e0cc
1 changed files with 3 additions and 1 deletions

View File

@ -20,6 +20,8 @@
$: isSingle = schema?.type === FieldType.ATTACHMENT_SINGLE
$: arrayValue = (value && !Array.isArray(value) ? [value] : value) || []
$: maximum = isSingle ? 1 : schema.constraints?.length?.maximum
$: editable = focused && !readonly
$: {
if (!focused) {
@ -111,7 +113,7 @@
value={arrayValue}
compact
on:change={onFileChange}
maximum={schema.constraints?.length?.maximum}
{maximum}
{processFiles}
{deleteAttachments}
{handleFileTooLarge}