Skip to content

Commit c8bea19

Browse files
authored
fix(ObjectPage): always show focused elements in content (#7104)
Fixes #7057 Fixes #7010
1 parent 45664cf commit c8bea19

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

packages/main/src/components/ObjectPage/ObjectPage.module.css

+6
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@
1313
white-space: normal;
1414
font-family: var(--sapFontFamily);
1515
background-color: var(--sapBackgroundColor);
16+
1617
overflow-x: hidden;
1718
overflow-y: auto;
1819
scroll-behavior: smooth;
20+
1921
&[data-in-iframe='true'] {
2022
scroll-behavior: auto;
2123
}
@@ -31,6 +33,10 @@
3133
}
3234
}
3335

36+
.withFooter {
37+
scroll-padding-block-end: calc(var(--_ui5wcr-BarHeight) + 0.5rem);
38+
}
39+
3440
.iconTabBarMode section[data-component-name='ObjectPageSection'] > div[role='heading'] {
3541
display: none;
3642
}

packages/main/src/components/ObjectPage/index.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,8 @@ const ObjectPage = forwardRef<ObjectPageDomRef, ObjectPagePropTypes>((props, ref
558558
const objectPageClasses = clsx(
559559
classNames.objectPage,
560560
className,
561-
mode === ObjectPageMode.IconTabBar && classNames.iconTabBarMode
561+
mode === ObjectPageMode.IconTabBar && classNames.iconTabBarMode,
562+
footerArea && classNames.withFooter
562563
);
563564

564565
const { onScroll: _0, selectedSubSectionId: _1, ...propsWithoutOmitted } = rest;
@@ -735,7 +736,8 @@ const ObjectPage = forwardRef<ObjectPageDomRef, ObjectPagePropTypes>((props, ref
735736
);
736737

737738
const objectPageStyles: CSSProperties = {
738-
...style
739+
...style,
740+
scrollPaddingBlockStart: `${Math.ceil(topHeaderHeight + TAB_CONTAINER_HEADER_HEIGHT + (!headerCollapsed && headerPinned ? headerContentHeight : 0))}px`
739741
};
740742
if (headerCollapsed === true && headerArea) {
741743
objectPageStyles[ObjectPageCssVariables.titleFontSize] = ThemingParameters.sapObjectHeader_Title_SnappedFontSize;

0 commit comments

Comments
 (0)