From 470ceaf9ae3ea1670c46421555ec0f2d32c3b4d3 Mon Sep 17 00:00:00 2001 From: Aditya Mittal Date: Thu, 8 Jun 2017 18:13:06 +0530 Subject: [PATCH 1/3] withResponsiveMode: Adding error handling around the case where window.innerWidth throws an exception --- .../src/utilities/decorators/withResponsiveMode.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/office-ui-fabric-react/src/utilities/decorators/withResponsiveMode.tsx b/packages/office-ui-fabric-react/src/utilities/decorators/withResponsiveMode.tsx index 85c0318046908..d7cffb5806324 100644 --- a/packages/office-ui-fabric-react/src/utilities/decorators/withResponsiveMode.tsx +++ b/packages/office-ui-fabric-react/src/utilities/decorators/withResponsiveMode.tsx @@ -75,8 +75,12 @@ export function withResponsiveMode

RESPONSIVE_MAX_CONSTRAINT[responsiveMode]) { - responsiveMode++; + try { + while (win.innerWidth > RESPONSIVE_MAX_CONSTRAINT[responsiveMode]) { + responsiveMode++; + } + } catch (e) { + responsiveMode = undefined; } } else { if (_defaultMode !== undefined) { From 2b5e70e61e2d15b9bfbc01a79727eb20edb4757a Mon Sep 17 00:00:00 2001 From: Aditya Mittal Date: Thu, 8 Jun 2017 18:15:46 +0530 Subject: [PATCH 2/3] adding change log file --- .../withResponsiveModeError_2017-06-08-12-44.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 common/changes/office-ui-fabric-react/withResponsiveModeError_2017-06-08-12-44.json diff --git a/common/changes/office-ui-fabric-react/withResponsiveModeError_2017-06-08-12-44.json b/common/changes/office-ui-fabric-react/withResponsiveModeError_2017-06-08-12-44.json new file mode 100644 index 0000000000000..d1aee3540cd18 --- /dev/null +++ b/common/changes/office-ui-fabric-react/withResponsiveModeError_2017-06-08-12-44.json @@ -0,0 +1,11 @@ +{ + "changes": [ + { + "packageName": "office-ui-fabric-react", + "comment": "withResponsiveMode: Adding error handling around the case where window.innerWidth throws an exception.", + "type": "patch" + } + ], + "packageName": "office-ui-fabric-react", + "email": "admitt@microsoft.com" +} \ No newline at end of file From 9169c530ba920b273420360a8d5f7ef94c04103a Mon Sep 17 00:00:00 2001 From: David Zearing Date: Mon, 12 Jun 2017 08:30:05 -0700 Subject: [PATCH 3/3] Create withResponsiveMode.tsx --- .../src/utilities/decorators/withResponsiveMode.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/office-ui-fabric-react/src/utilities/decorators/withResponsiveMode.tsx b/packages/office-ui-fabric-react/src/utilities/decorators/withResponsiveMode.tsx index d7cffb5806324..3680f2b278c72 100644 --- a/packages/office-ui-fabric-react/src/utilities/decorators/withResponsiveMode.tsx +++ b/packages/office-ui-fabric-react/src/utilities/decorators/withResponsiveMode.tsx @@ -80,7 +80,8 @@ export function withResponsiveMode