From 66e8e6404d87a2767e71b13bed19706b29ad1b9c Mon Sep 17 00:00:00 2001 From: Liam DeBeasi Date: Mon, 27 Apr 2020 11:29:44 -0400 Subject: [PATCH] fix(select): account for MutationObserver when performing SSR (#21068) fixes #21063 --- core/src/utils/watch-options.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/utils/watch-options.ts b/core/src/utils/watch-options.ts index 423fea924b..184c27ea63 100644 --- a/core/src/utils/watch-options.ts +++ b/core/src/utils/watch-options.ts @@ -1,4 +1,7 @@ export const watchForOptions = (containerEl: HTMLElement, tagName: string, onChange: (el: T | undefined) => void) => { + /* tslint:disable-next-line */ + if (typeof MutationObserver === 'undefined') { return; } + const mutation = new MutationObserver(mutationList => { onChange(getSelectedOption(mutationList, tagName)); });