Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions packages/main/src/components/ObjectPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -731,12 +731,16 @@ const ObjectPage = forwardRef<ObjectPageDomRef, ObjectPagePropTypes>((props, ref
ref={objectPageContentRef}
// prevent content scroll when elements outside the content are focused
onFocus={() => {
// 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}`;
const opNode = objectPageRef.current;
if (opNode) {
// 12px or 0.75rem margin for ui5wc border and input margins
opNode.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.scrollPaddingBlock = '0px';
const opNode = objectPageRef.current;
if (opNode && !e.currentTarget.contains(e.relatedTarget as Node)) {
opNode.style.scrollPaddingBlock = '0px';
}
}}
>
Expand Down
Loading