File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1- import React , { useState } from 'react'
1+ import React , { useState , useEffect } from 'react'
22import PropTypes from 'prop-types'
33import styles from './styles.module.scss'
44
@@ -22,6 +22,16 @@ const LoginNav = ({
2222 const [ openNotifications , setOpenNotifications ] = useState ( )
2323 const [ openAccountMenu , setOpenAccountMenu ] = useState ( )
2424
25+ useEffect ( ( ) => {
26+ // trigger when orientationChange in ipad
27+ const onOrientationChange = ( ) => {
28+ setOpenNotifications ( false )
29+ setOpenAccountMenu ( false )
30+ document . body . style . position = ''
31+ }
32+ window . addEventListener ( 'orientationchange' , onOrientationChange )
33+ return ( ) => window . removeEventListener ( 'orientationchange' , onOrientationChange )
34+ } , [ ] )
2535 const handleClickNotifications = ( ) => setOpenNotifications ( x => ! x )
2636
2737 const handleClickUserInfo = ( ) => {
You can’t perform that action at this time.
0 commit comments