File tree Expand file tree Collapse file tree
packages/react/src/components/UIShell Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ import { keys, match } from '../../internal/keyboard';
2323import { useMergedRefs } from '../../internal/useMergedRefs' ;
2424import { useWindowEvent } from '../../internal/useEvent' ;
2525import { useDelayedState } from '../../internal/useDelayedState' ;
26+ import { breakpoints } from '@carbon/layout' ;
27+ import { useMatchMedia } from '../../internal/useMatchMedia' ;
2628// TO-DO: comment back in when footer is added for rails
2729// import SideNavFooter from './SideNavFooter';
2830
@@ -224,6 +226,9 @@ function SideNavRenderFunction(
224226 }
225227 } ) ;
226228
229+ const lgMediaQuery = `(min-width: ${ breakpoints . lg . width } )` ;
230+ const isLg = useMatchMedia ( lgMediaQuery ) ;
231+
227232 return (
228233 < SideNavContext . Provider value = { { isRail } } >
229234 { isFixedNav ? null : (
@@ -234,7 +239,7 @@ function SideNavRenderFunction(
234239 tabIndex = { - 1 }
235240 ref = { navRef }
236241 className = { `${ prefix } --side-nav__navigation ${ className } ` }
237- inert = { ! isRail && ( expanded ? undefined : - 1 ) }
242+ inert = { ! isRail && ( expanded || isLg ? undefined : - 1 ) }
238243 { ...accessibilityLabel }
239244 { ...eventHandlers }
240245 { ...other } >
You can’t perform that action at this time.
0 commit comments