-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(radio): only emit change event with user input #1680
Conversation
@@ -152,21 +152,22 @@ describe('MdRadio', () => { | |||
expect(spies[1]).toHaveBeenCalledTimes(1); | |||
}); | |||
|
|||
it('should emit a change event from the radio group', () => { | |||
it('should not emit a change event from the radio group when change group value ' | |||
+ 'programmatically', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you considered using backticks instead? That way you don't need the +
@@ -242,34 +243,36 @@ describe('MdRadio', () => { | |||
|
|||
fixture.detectChanges(); | |||
|
|||
expect(changeSpy).toHaveBeenCalled(); | |||
expect(changeSpy).toHaveBeenCalledTimes(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you can do
expect(changeSpy).not.toHaveBeenCalled()
Might be more natural-sounding
@@ -171,6 +166,13 @@ export class MdRadioGroup implements AfterContentInit, ControlValueAccessor { | |||
} | |||
} | |||
|
|||
emitChangeEvent(): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you want this to be part of the public API? It seems to me like it should use the _
prefix convention so people know it's internal (only used by the button)
813ad00
to
7c7cff7
Compare
Comment addressed. Please take another look. Thanks for review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Closes #1523
R: @kara @jelbourn