Skip to content

Commit

Permalink
fix: add optional label to file list
Browse files Browse the repository at this point in the history
  • Loading branch information
KovaCro committed Jan 2, 2024
1 parent ddadc58 commit d923b5d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/docs/Form fields/file-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
| Name | Required | Type | Description |
|:--------:|:------------:|:------------:|:------------------------:|
| value | | `string` (list of urls separated by comma) | initial value |
| label | | `string` (HTML) | displayed above the field |
| id | | `string` | unique identifier |
| name || `string` | name of the form control |
| service || [`FileService`](#fileservice) | file service |
Expand Down
8 changes: 8 additions & 0 deletions packages/lib/src/form-fields/file-list.wc.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
export let attachedInternals: ElementInternals;
export let value: string = '';
export let label: string = '';
export let id: string = '';
export let name: string = '';
export let service: FileService;
Expand Down Expand Up @@ -202,6 +203,13 @@
}}
/>

{#if label}
<!-- svelte-ignore a11y-label-has-associated-control -->
<label>
{@html label}
</label>
{/if}

<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
class="dropzone"
Expand Down

0 comments on commit d923b5d

Please sign in to comment.