Skip to content

Commit 238ffea

Browse files
committed
fix(material-experimental/mdc-slider): code review changes
* add todo to remember to add the mdc-slider back into the kitchen sink ssr app * move _foundation.init() into the _platform.isBrowser check to avoid ssr problems
1 parent 82fb30f commit 238ffea

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/material-experimental/mdc-slider/slider-adapter.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ export class SliderAdapter implements MDCSliderAdapter {
8080
return this._delegate._getInput(thumb)._isFocused();
8181
}
8282
getThumbKnobWidth = (thumb: Thumb): number => {
83+
// TODO(wagnermaciel): Check if this causes issues for SSR
84+
// once the mdc-slider is added back to the kitchen sink SSR app.
8385
return this._delegate._getKnobElement(thumb).getBoundingClientRect().width;
8486
}
8587
getThumbBoundingClientRect = (thumb: Thumb): ClientRect => {

src/material-experimental/mdc-slider/slider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,11 +151,11 @@ export class MatSlider implements AfterViewInit, OnDestroy {
151151

152152
ngAfterViewInit() {
153153
this._validateInputs();
154-
this._foundation.init();
155154
if (this._platform.isBrowser) {
155+
this._foundation.init();
156156
this._foundation.layout();
157+
this._initialized = true;
157158
}
158-
this._initialized = true;
159159
}
160160

161161
ngOnDestroy() {

0 commit comments

Comments
 (0)