Skip to content

Commit 2180607

Browse files
committed
Fixed problems with the prerender
1 parent 3a1eff0 commit 2180607

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/lib/select/select.spec.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3178,13 +3178,15 @@ class SelectWithGroups {
31783178
@ViewChildren(MdOption) options: QueryList<MdOption>;
31793179
}
31803180

3181+
31813182
@Component({
31823183
template: `<form><md-select [(ngModel)]="value"></md-select></form>`
31833184
})
31843185
class InvalidSelectInForm {
31853186
value: any;
31863187
}
31873188

3189+
31883190
@Component({
31893191
template: `
31903192
<form [formGroup]="formGroup">

src/lib/select/select.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -712,14 +712,10 @@ export class MdSelect extends _MdSelectMixinBase implements AfterContentInit, On
712712
*/
713713
private _selectValue(value: any, isUserInput = false): MdOption|undefined {
714714
const optionsArray = this.options.toArray();
715-
716715
const correspondingOption = optionsArray.find((option: MdOption) => {
717-
// Treat null as a special reset value.
718-
if (option.value === null) {
719-
return false;
720-
}
721716
try {
722-
return this._compareWith(option.value, value);
717+
// Treat null as a special reset value.
718+
return option.value != null && this._compareWith(option.value, value);
723719
} catch (error) {
724720
if (isDevMode()) {
725721
// Notify developers of errors in their comparator.

0 commit comments

Comments
 (0)