Skip to content

Commit

Permalink
Update useIsLandscape.tsx (#1199)
Browse files Browse the repository at this point in the history
Fix crashing on changing orientation for some devices
  • Loading branch information
lifeiscontent authored and dmtrKovalenko committed Jul 24, 2019
1 parent 4ef9a9f commit 8d9fe9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/_shared/hooks/useIsLandscape.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { BasePickerProps } from '../../typings/BasePicker';
const getOrientation = () =>
typeof window !== 'undefined' &&
window.screen &&
window.orientation &&
window.screen.orientation &&
Math.abs(window.screen.orientation.angle) === 90
? 'landscape'
: 'portrait';
Expand Down

0 comments on commit 8d9fe9f

Please sign in to comment.