Skip to content

Commit

Permalink
Components: Fix Zoom for IE 11
Browse files Browse the repository at this point in the history
  • Loading branch information
tooppaaa committed Nov 26, 2020
1 parent 1867db5 commit 202f166
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/components/src/Zoom/Zoom.tsx
Expand Up @@ -2,8 +2,13 @@ import window from 'global';
import { ZoomElement as Element } from './ZoomElement';
import { ZoomIFrame as IFrame } from './ZoomIFrame';

export const browserSupportsCssZoom = (): boolean =>
window.document.implementation.createHTMLDocument().body.style.zoom !== undefined;
export const browserSupportsCssZoom = (): boolean => {
try {
return window.document.implementation.createHTMLDocument('').body.style.zoom !== undefined;
} catch (error) {
return false;
}
};

export const Zoom = {
Element,
Expand Down

0 comments on commit 202f166

Please sign in to comment.