Skip to content

Setting md-radio-group value dynamically does not change 'checked' property of md-radio-button #1152

Closed
@james11a

Description

@james11a

Bug, feature request, or proposal:

Bug:
Setting md-radio-group value dynamically does not change 'checked' property of md-radio-button (md-radio-checked class is not enabled for this radio button)

What is the expected behavior?

When md-radio-group value is changed to one of the md-radio-button values, the corresponding radio button should get checked (md-radio-checked class should be enabled for the radio button)

What is the current behavior?

Initial md-radio-group value ensures that correct radio button is checked when application starts but changing the md-radio-group value dynamically does not do the same.

What are the steps to reproduce?

  1. Visit plunker: http://plnkr.co/edit/rzemQv9oNEpt4yOYuT0u?p=preview
    Initial value of md-radio-group is set to 'Jack' which is same as the value of '1st radio button (Custom Name)'. Here the Custom Name radio button is checked, so it works as required.

  2. Select 2nd radio button (Default), then the Default radio button gets checked, md-radio-group value is also updated.

  3. Now change the custom name to say 'xyz', the md-radio-group value & the 'Custom Name' radio button values get updated to 'xyz' but the md-radio-checked class is not set for 'Custom Name' radio.

Which versions of Angular, Material, OS, browsers are affected?

The example in plunker is with Angular 2.0.0-rc.1 & material 2.0.0-alpha.5 but the problem is also reproduced with the latest Angular 2.0.0-rc.5 & material 2.0.0-alpha.7-4 which I am using at work.

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions