Skip to content

Commit 4e8d2e1

Browse files
committed
fix
1 parent 85829fe commit 4e8d2e1

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

src/app-layout/__tests__/main.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ describeEachAppLayout({ themes: ['classic', 'refresh-toolbar'], sizes: ['desktop
121121
await waitFor(() => expect(wrapper.getElement()).toHaveStyle({ minBlockSize: 'calc(100vh - 75px)' }));
122122
});
123123

124-
(theme !== 'classic' ? test.skip : test.skip)('should set the header height to the scrolling element', () => {
124+
(theme !== 'classic' ? test : test.skip)('should set the header height to the scrolling element', () => {
125125
Object.defineProperty(document, 'scrollingElement', { value: document.body });
126126
renderComponent(
127127
<div id="b">

src/app-layout/visual-refresh-toolbar/state/index.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import React, { ForwardedRef, useLayoutEffect, useState } from 'react';
44

55
import { createWidgetizedComponent } from '../../../internal/widgets';
66
import { AppLayoutProps } from '../../interfaces';
7-
import { useGlobalScrollPadding } from '../../utils/use-global-scroll-padding';
87
import { AppLayoutInternalProps, AppLayoutState } from '../interfaces';
98
import { SkeletonSlotsAttributes } from '../skeleton/interfaces';
109
import { MergeProps, SharedProps } from './interfaces';
@@ -36,8 +35,6 @@ export const AppLayoutStateProvider = ({ appLayoutProps, stateManager, forwardRe
3635
const appLayoutState = useAppLayout(hasToolbar, appLayoutProps, forwardRef);
3736
const skeletonSlotsAttributes = useSkeletonSlotsAttributes(hasToolbar, appLayoutProps, appLayoutState);
3837

39-
useGlobalScrollPadding(appLayoutState.widgetizedState?.verticalOffsets.header ?? 0);
40-
4138
useLayoutEffect(() => {
4239
if (!stateManager.current?.setState) {
4340
console.warn('AppLayout state manager is not found');

src/app-layout/visual-refresh-toolbar/state/use-app-layout.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {
2424
} from '../compute-layout';
2525
import { AppLayoutState } from '../interfaces';
2626
import { AppLayoutInternalProps, AppLayoutInternals } from '../interfaces';
27+
import { useGlobalScrollPadding } from '../../utils/use-global-scroll-padding';
2728

2829
export const useAppLayout = (
2930
hasToolbar: boolean,
@@ -264,6 +265,8 @@ export const useAppLayout = (
264265

265266
const { ref: intersectionObserverRef, isIntersecting } = useIntersectionObserver({ initialState: true });
266267

268+
useGlobalScrollPadding(verticalOffsets.header ?? 0);
269+
267270
const appLayoutInternals: AppLayoutInternals = {
268271
ariaLabels: ariaLabelsWithDrawers,
269272
headerVariant,

src/app-layout/visual-refresh-toolbar/widget-areas/before-main-slot.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ export const BeforeMainSlotImplementation = ({ toolbarProps, appLayoutState }: S
1818
const { activeDrawer, navigationOpen, navigation, expandedDrawerId } = appLayoutState.widgetizedState;
1919
const drawerExpandedMode = !!expandedDrawerId;
2020
const toolsOpen = !!activeDrawer;
21-
// Must use `widgetizedProps` because all layouts have to apply this mode, not just the one with toolbar
22-
const drawerExpandedModeInChildLayout =
23-
toolbarProps?.widgetizedProps?.expandedDrawerId ?? !!toolbarProps?.expandedDrawerId;
21+
// Must use `toolbarProps` because all layouts have to apply this mode, not just the one with toolbar
22+
const drawerExpandedModeInChildLayout = !!toolbarProps?.expandedDrawerId;
2423
return (
2524
<>
2625
{!!toolbarProps && (

0 commit comments

Comments
 (0)