Skip to content

Commit 0314bd8

Browse files
crisbetoandrewseguin
authored andcommitted
fix(checkbox): server-side rendering error when checking textContent (#5470)
Adds an extra null check when trimming the checkbox `textContent`. This avoids issues in Universal where the `textContent` will be undefined. Fixes #5453.
1 parent 41c804b commit 0314bd8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/lib/checkbox/checkbox.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<label [attr.for]="inputId" class="mat-checkbox-layout" #label>
22
<div class="mat-checkbox-inner-container"
3-
[class.mat-checkbox-inner-container-no-side-margin]="!checkboxLabel.textContent.trim()">
3+
[class.mat-checkbox-inner-container-no-side-margin]="!checkboxLabel.textContent || !checkboxLabel.textContent.trim()">
44
<input #input
55
class="mat-checkbox-input cdk-visually-hidden" type="checkbox"
66
[id]="inputId"

0 commit comments

Comments
 (0)