Skip to content
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

Merged
merged 3 commits into from
Nov 3, 2016

Conversation

tinayuangao
Copy link
Contributor

Closes #1523

R: @kara @jelbourn

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 1, 2016
@@ -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', () => {
Copy link
Contributor

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);
Copy link
Contributor

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 {
Copy link
Contributor

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)

@tinayuangao
Copy link
Contributor Author

Comment addressed. Please take another look. Thanks for review!

Copy link
Contributor

@kara kara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tinayuangao tinayuangao added the action: merge The PR is ready for merge by the caretaker label Nov 1, 2016
@jelbourn jelbourn merged commit 0d552f5 into angular:master Nov 3, 2016
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Radio group change event should only fire with user interaction
4 participants