Protect from no IntersectionObserver while SSR (#206)
This commit is contained in:
parent
f3318446f8
commit
8bea5e0355
|
@ -130,6 +130,9 @@ class TimeSelectorView extends TemplateView {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Avoid an error when server-side rendering (SSR) because it doesn't have all the
|
||||||
|
// DOM API's available (and doesn't need it for this case)
|
||||||
|
if (typeof IntersectionObserver === 'function') {
|
||||||
// Since this lives in the right-panel which is conditionally hidden from view with
|
// Since this lives in the right-panel which is conditionally hidden from view with
|
||||||
// `display: none;`, we have to re-evaluate the scrubber scroll position when it
|
// `display: none;`, we have to re-evaluate the scrubber scroll position when it
|
||||||
// becomes visible because client dimensions evaluate to `0` when something is
|
// becomes visible because client dimensions evaluate to `0` when something is
|
||||||
|
@ -157,6 +160,7 @@ class TimeSelectorView extends TemplateView {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const timeInput = t.input({
|
const timeInput = t.input({
|
||||||
type: 'time',
|
type: 'time',
|
||||||
|
|
Loading…
Reference in New Issue