Skip to content

Commit

Permalink
fix(RadioGroup): pass option.disabled to children
Browse files Browse the repository at this point in the history
Fixes #1109
  • Loading branch information
benjamincanac committed Dec 15, 2023
1 parent 0fdc8f7 commit 0c8ab9d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions docs/content/3.forms/6.radio-group.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ Use the `disabled` prop to disable the RadioGroup.
::component-card
---
baseProps:
options: [{ value: 'email', label: 'Email' }, { value: 'sms', label: 'Phone (SMS)' }, { value: 'push', label: 'Push notification' }]
options: [{ value: 'email', label: 'Email' }, { value: 'sms', label: 'Phone (SMS)' }, { value: 'push', label: 'Push notification', disabled: true }]
modelValue: 'sms'
props:
disabled: true
---
::

::callout{icon="i-heroicons-light-bulb"}
This prop also work on the Radio component.
This prop also work on the Radio component and you can set the `disabled` field in the `options` to disable a specific Radio.
::

### Label
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/forms/RadioGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
:label="option.label"
:model-value="modelValue"
:value="option.value"
:disabled="disabled"
:disabled="option.disabled || disabled"
:ui="uiRadio"
@change="onUpdate(option.value)"
>
Expand Down

0 comments on commit 0c8ab9d

Please sign in to comment.