Skip to content

Commit

Permalink
fix(select): account for MutationObserver when performing SSR (#21068)
Browse files Browse the repository at this point in the history
fixes #21063
  • Loading branch information
liamdebeasi committed Apr 27, 2020
1 parent 4bd9134 commit 66e8e64
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/src/utils/watch-options.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
export const watchForOptions = <T extends HTMLElement>(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<T>(mutationList, tagName));
});
Expand Down

0 comments on commit 66e8e64

Please sign in to comment.