Skip to content

Commit 1cd5bb0

Browse files
committed
feat(ObjectPageSection): add tabRef prop
1 parent ecf0fc1 commit 1cd5bb0

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -698,6 +698,7 @@ const ObjectPage = forwardRef<ObjectPageDomRef, ObjectPagePropTypes>((props, ref
698698
return (
699699
<Tab
700700
key={`Anchor-${section.props?.id}`}
701+
ref={section.props.tabRef}
701702
data-index={index}
702703
data-section-id={section.props.id}
703704
text={section.props.titleText}

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
import type TitleLevel from '@ui5/webcomponents/dist/types/TitleLevel.js';
44
import { useStylesheet } from '@ui5/webcomponents-react-base';
55
import { clsx } from 'clsx';
6-
import type { ReactNode } from 'react';
6+
import type { ReactNode, Ref } from 'react';
77
import { forwardRef } from 'react';
88
import type { CommonProps } from '../../types/index.js';
9+
import type { TabDomRef } from '../../webComponents/Tab/index.js';
910
import { classNames, styleData } from './ObjectPageSection.module.css.js';
1011

1112
export interface ObjectPageSectionPropTypes extends CommonProps {
@@ -54,6 +55,12 @@ export interface ObjectPageSectionPropTypes extends CommonProps {
5455
* __Note__: Although this prop accepts all HTML Elements, it is strongly recommended that you only use non-focusable elements to preserve the intended design.
5556
*/
5657
header?: ReactNode;
58+
// the ref is applied in the ObjectPage
59+
/**
60+
* This ref will be attached to the underlying `ui5-tab` DOM element,
61+
* allowing direct access to its instance methods and properties (e.g. `getDomRefInStrip`).
62+
*/
63+
tabRef?: Ref<TabDomRef>;
5764
}
5865

5966
/**

0 commit comments

Comments
 (0)