From a6053216be63262e06c84c3823a929dc7c870a77 Mon Sep 17 00:00:00 2001 From: Lukas Harbarth Date: Wed, 23 Apr 2025 15:27:15 +0200 Subject: [PATCH] fix(ObjectPage): fix scroll-into-view behavior for Chromium browsers --- packages/main/src/components/ObjectPage/index.tsx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/packages/main/src/components/ObjectPage/index.tsx b/packages/main/src/components/ObjectPage/index.tsx index 88d81d7dff6..4e2b7b3617b 100644 --- a/packages/main/src/components/ObjectPage/index.tsx +++ b/packages/main/src/components/ObjectPage/index.tsx @@ -731,15 +731,12 @@ const ObjectPage = forwardRef((props, ref ref={objectPageContentRef} // prevent content scroll when elements outside the content are focused onFocus={() => { - objectPageRef.current.style.scrollPaddingBlockStart = `${Math.ceil(topHeaderHeight + TAB_CONTAINER_HEADER_HEIGHT + (!headerCollapsed && headerPinned ? headerContentHeight : 0))}px`; - if (footerArea) { - objectPageRef.current.style.scrollPaddingBlockEnd = 'calc(var(--_ui5wcr-BarHeight) + 0.5rem)'; - } + // 12px or 0.75rem margin for ui5wc border and input margins + 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}`; }} onBlur={(e) => { if (!e.currentTarget.contains(e.relatedTarget as Node)) { - objectPageRef.current.style.scrollPaddingBlockStart = '0px'; - objectPageRef.current.style.scrollPaddingBlockEnd = '0px'; + objectPageRef.current.style.scrollPaddingBlock = '0px'; } }} >