Skip to content

Commit eef4203

Browse files
committed
add menuTab property to TabPane
1 parent f6b8589 commit eef4203

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

examples/overflow.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ for (let i = 0; i < 50; i += 1) {
1313
);
1414
}
1515

16+
// add a tab to demo the menuTab feature
17+
tabs.push(
18+
<TabPane key={50} menuTab='Fancy Tab' tab={(<span><span style={{ 'color': 'red' }}> Fancy </span> Tab </span>)}>
19+
Show different tab in the dropdown menu with the menuTab property.
20+
</TabPane>,
21+
);
22+
1623
export default () => {
1724
const [gutter, setGutter] = React.useState(true);
1825
const [destroy, setDestroy] = React.useState(false);

src/TabNavList/OperationNode.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function OperationNode(
7373
aria-controls={id && `${id}-panel-${tab.key}`}
7474
disabled={tab.disabled}
7575
>
76-
{tab.tab}
76+
{tab.menuTab || tab.tab}
7777
</MenuItem>
7878
))}
7979
</Menu>

src/TabPanelList/TabPane.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import classNames from 'classnames';
33

44
export interface TabPaneProps {
55
tab?: React.ReactNode;
6+
menuTab?: React.ReactNode;
67
className?: string;
78
style?: React.CSSProperties;
89
disabled?: boolean;

0 commit comments

Comments
 (0)