Skip to content

Commit

Permalink
fix(radio): radio button value should be initialized by default
Browse files Browse the repository at this point in the history
closes #504
  • Loading branch information
stasson committed Aug 7, 2018
1 parent 95c34ec commit 9fed121
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
26 changes: 13 additions & 13 deletions components/radio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,24 +26,24 @@ var vm = new Vue({

### props

| props | Type | Default | Description |
|-------|------|---------|-------------|
|`name`|String || radio group name (__*__) |
|`label`| String|static| radio label |
|`align-end`| Boolean|| align the radio after the label |
|`value`|String|| input control value |
|`checked`|Boolean|| forces this radio to be selected. follows v-model otherwise |
|`:disabled`| Boolean|| whether the radio is disabled |
|`v-model`| String || tracks selected radio's value |
| props | Type | Default | Description |
| ----------- | ------- | ------- | ----------------------------------------------------------- |
| `name` | String | | radio group name (__*__) |
| `label` | String | | radio label |
| `align-end` | Boolean | | align the radio after the label |
| `value` | String | `label` | radio value, defaults to label value if any |
| `checked` | Boolean | | forces this radio to be selected. follows v-model otherwise |
| `:disabled` | Boolean | | whether the radio is disabled |
| `v-model` | String | | tracks selected radio's value |

> (__*__) name prop is required for proper behavior.
### events

| event | args | Description |
|-------|------|-------------|
|`@focus`| - |emitted on focus gained |
|`@blur`| - |emitted on focus lost |
| event | args | Description |
| -------- | ---- | ----------------------- |
| `@focus` | - | emitted on focus gained |
| `@blur` | - | emitted on focus lost |

### Reference

Expand Down
2 changes: 1 addition & 1 deletion components/radio/mdc-radio.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default {
this.ripple.init()
this.formField.init()
this.value && this.foundation.setValue(this.value)
this.foundation.setValue(this.value || this.label)
this.foundation.setDisabled(this.disabled)
this.foundation.setChecked(
this.checked || this.picked == this.foundation.getValue()
Expand Down

0 comments on commit 9fed121

Please sign in to comment.