@@ -7,7 +7,6 @@ import { useMergeRefs, useStableCallback, useUniqueId } from '@cloudscape-design
7
7
import { SplitPanelSideToggleProps } from '../../../internal/context/split-panel-context' ;
8
8
import { fireNonCancelableEvent } from '../../../internal/events' ;
9
9
import { useControllable } from '../../../internal/hooks/use-controllable' ;
10
- import { useIntersectionObserver } from '../../../internal/hooks/use-intersection-observer' ;
11
10
import { useMobile } from '../../../internal/hooks/use-mobile' ;
12
11
import { useGetGlobalBreadcrumbs } from '../../../internal/plugins/helpers/use-global-breadcrumbs' ;
13
12
import globalVars from '../../../internal/styles/global-vars' ;
@@ -26,6 +25,7 @@ import {
26
25
} from '../compute-layout' ;
27
26
import { AppLayoutState } from '../interfaces' ;
28
27
import { AppLayoutInternalProps , AppLayoutInternals } from '../interfaces' ;
28
+ import { useAppLayoutVisible } from './use-app-layout-visible' ;
29
29
30
30
export const useAppLayout = (
31
31
hasToolbar : boolean ,
@@ -259,9 +259,8 @@ export const useAppLayout = (
259
259
stickyNotifications : resolvedStickyNotifications ,
260
260
} ) ;
261
261
262
- const { ref : intersectionObserverRef , isIntersecting } = useIntersectionObserver ( { initialState : true } ) ;
263
-
264
- const rootRef = useMergeRefs ( rootRefInternal , intersectionObserverRef , onMountRootRef ) ;
262
+ const { ref : visibilityObserverRef , isVisible } = useAppLayoutVisible ( ) ;
263
+ const rootRef = useMergeRefs ( rootRefInternal , visibilityObserverRef , onMountRootRef ) ;
265
264
266
265
const discoveredBreadcrumbs = useGetGlobalBreadcrumbs ( hasToolbar && ! breadcrumbs ) ;
267
266
@@ -431,7 +430,7 @@ export const useAppLayout = (
431
430
432
431
return {
433
432
rootRef,
434
- isIntersecting,
433
+ isIntersecting : isVisible ,
435
434
appLayoutInternals,
436
435
splitPanelInternals,
437
436
widgetizedState : {
0 commit comments