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
…5470)

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 28, 2017
1 parent 41c804b commit 0314bd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/checkbox/checkbox.html
@@ -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 0314bd8

Please sign in to comment.