diff --git a/packages/react/src/components/device-context-provider/device-context-provider.test.tsx b/packages/react/src/components/device-context-provider/device-context-provider.test.tsx index b91e759af3..676d28f4b1 100644 --- a/packages/react/src/components/device-context-provider/device-context-provider.test.tsx +++ b/packages/react/src/components/device-context-provider/device-context-provider.test.tsx @@ -32,7 +32,7 @@ function getContextObject( } function setScreenWidth(width: number): void { - Object.defineProperty(window, 'outerWidth', { writable: true, configurable: true, value: width }); + Object.defineProperty(window, 'innerWidth', { writable: true, configurable: true, value: width }); } describe('Device Context Provider', () => { diff --git a/packages/react/src/components/device-context-provider/device-context-provider.tsx b/packages/react/src/components/device-context-provider/device-context-provider.tsx index efd7087d94..71da2e5caa 100644 --- a/packages/react/src/components/device-context-provider/device-context-provider.tsx +++ b/packages/react/src/components/device-context-provider/device-context-provider.tsx @@ -69,7 +69,7 @@ export const DeviceContextProvider: FunctionComponent(getDeviceContext(staticDevice)); function handleScreenResize(): void { - const screenWidth = (window.outerWidth || document.documentElement.clientWidth); + const screenWidth = (window.innerWidth || document.documentElement.clientWidth); const currentDevice = getDevice(screenWidth); setDevice(getDeviceContext(currentDevice));