Skip to content

Commit

Permalink
Merge pull request #13302 from storybookjs/fix/ie11Zoom
Browse files Browse the repository at this point in the history
Components: Fix Zoom for IE 11
  • Loading branch information
shilman committed Nov 27, 2020
2 parents b466006 + 202f166 commit 8b29285
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 8b29285

Please sign in to comment.