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(selection-list): fix option value coercion and selection events #6901

Merged
merged 5 commits into from
Oct 12, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/lib/list/selection-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class MatListOption extends _MatListOptionMixinBase
@Input()
get selected(): boolean { return this.selectionList.selectedOptions.isSelected(this); }
set selected(value: boolean) {
const isSelected = coerceBooleanProperty(value);
const isSelected: boolean = coerceBooleanProperty(value);
Copy link
Contributor

@rafaelss95 rafaelss95 Oct 12, 2017

Choose a reason for hiding this comment

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

I think you misunderstood what I mean... I mean that we have the following signature for selected: set selected(value: boolean) { ... = coerceBooleanProperty(value); }, so the disabled should follow the same thing.

Basically change the signature of disabled from set disabled(value: any) { to set disabled(value: boolean) {.

Did you get it now?

This :boolean added here is unnecessary.

Copy link
Contributor Author

@dereekb dereekb Oct 12, 2017

Choose a reason for hiding this comment

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

Yea, the highlighted section GitHub was showing was:

/** Value of the option */
-  @Input() value: any;

So I didn't really get what you were talking about. It's changed now and I removed the unnecessary :boolean.

Copy link
Contributor

Choose a reason for hiding this comment

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

Aha, ok. Nice :)

Will you remove this :boolean in another commit?

Copy link
Contributor Author

@dereekb dereekb Oct 12, 2017

Choose a reason for hiding this comment

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

That's the second time today I've committed without first hitting save. Done.


if (isSelected !== this.selected) {
this.selectionList.selectedOptions.toggle(this);
Expand Down