Skip to content

Commit 16e0f49

Browse files
authored
fix(ObjectPage): fix scroll-into-view behavior for Chromium browsers (#7266)
Fixes #7057 Related Chromium bug: https://issues.chromium.org/issues/41435274
1 parent 4803abb commit 16e0f49

File tree

1 file changed

+3
-6
lines changed
  • packages/main/src/components/ObjectPage

1 file changed

+3
-6
lines changed

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

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -731,15 +731,12 @@ const ObjectPage = forwardRef<ObjectPageDomRef, ObjectPagePropTypes>((props, ref
731731
ref={objectPageContentRef}
732732
// prevent content scroll when elements outside the content are focused
733733
onFocus={() => {
734-
objectPageRef.current.style.scrollPaddingBlockStart = `${Math.ceil(topHeaderHeight + TAB_CONTAINER_HEADER_HEIGHT + (!headerCollapsed && headerPinned ? headerContentHeight : 0))}px`;
735-
if (footerArea) {
736-
objectPageRef.current.style.scrollPaddingBlockEnd = 'calc(var(--_ui5wcr-BarHeight) + 0.5rem)';
737-
}
734+
// 12px or 0.75rem margin for ui5wc border and input margins
735+
objectPageRef.current.style.scrollPaddingBlock = `${Math.ceil(12 + topHeaderHeight + TAB_CONTAINER_HEADER_HEIGHT + (!headerCollapsed && headerPinned ? headerContentHeight : 0))}px ${footerArea ? 'calc(var(--_ui5wcr-BarHeight) + 1.25rem)' : 0}`;
738736
}}
739737
onBlur={(e) => {
740738
if (!e.currentTarget.contains(e.relatedTarget as Node)) {
741-
objectPageRef.current.style.scrollPaddingBlockStart = '0px';
742-
objectPageRef.current.style.scrollPaddingBlockEnd = '0px';
739+
objectPageRef.current.style.scrollPaddingBlock = '0px';
743740
}
744741
}}
745742
>

0 commit comments

Comments
 (0)