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)); });