Skip to content

Commit

Permalink
fix(checkbox): server-side rendering error when checking textContent
Browse files Browse the repository at this point in the history
Adds an extra null check when trimming the checkbox `textContent`. This avoids issues in Universal where the `textContent` will be undefined.

Fixes #5453.
  • Loading branch information
crisbeto authored and andrewseguin committed Jul 27, 2017
1 parent 3bfe7f0 commit e91db6b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/checkbox/checkbox.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<label [attr.for]="inputId" class="mat-checkbox-layout" #label>
<div class="mat-checkbox-inner-container"
[class.mat-checkbox-inner-container-no-side-margin]="!checkboxLabel.textContent.trim()">
[class.mat-checkbox-inner-container-no-side-margin]="!checkboxLabel.textContent || !checkboxLabel.textContent.trim()">
<input #input
class="mat-checkbox-input cdk-visually-hidden" type="checkbox"
[id]="inputId"
Expand Down

0 comments on commit e91db6b

Please sign in to comment.