Skip to content

Commit

Permalink
fix: radio inline attribute and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
KovaCro committed Jan 1, 2024
1 parent eada664 commit fdbf0b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/docs/Form fields/radio.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
### Attributes
| **Name** | **Required** | **Type** | **Description** |
| :----: | :----: | :----: | :---: |
| value | | `string` | initial value |
| options ||`Array<{name?: string, value: any, disabled?: boolean;}>` | select options |
| name || `string` | name of the form control |
| inline | | `boolean` | row/columns |
| required | | `boolean` | determines if a selection is required |
| requiredValidationMessage | | `string` | validation message for when component does not satisfy required |

Expand Down
3 changes: 2 additions & 1 deletion packages/lib/src/form-fields/radio.wc.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
export let required: boolean = false;
export let value: string = '';
export let name: string | null = null;
export let inline: boolean = false;
export let requiredValidationMessage;
Expand Down Expand Up @@ -54,7 +55,7 @@
});
</script>

<div class="flex flex-col">
<div style={`display: flex; flex-direction: ${inline ? 'row' : 'column'}`}>
{#each options as option}
<label class:disabled={option.disabled}>
<input
Expand Down

0 comments on commit fdbf0b8

Please sign in to comment.