Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: TabPane needs an additional property for tab displayed in overflow dropdown #331

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions examples/overflow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ for (let i = 0; i < 50; i += 1) {
);
}

// add a tab to demo the menuTab feature
tabs.push(
<TabPane key={50} menuTab='Fancy Tab' tab={(<span><span style={{ 'color': 'red' }}> Fancy </span> Tab </span>)}>
Show different tab in the dropdown menu with the menuTab property.
</TabPane>,
);

export default () => {
const [gutter, setGutter] = React.useState(true);
const [destroy, setDestroy] = React.useState(false);
Expand Down
2 changes: 1 addition & 1 deletion src/TabNavList/OperationNode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ function OperationNode(
aria-controls={id && `${id}-panel-${tab.key}`}
disabled={tab.disabled}
>
{tab.tab}
{tab.menuTab || tab.tab}
</MenuItem>
))}
</Menu>
Expand Down
1 change: 1 addition & 0 deletions src/TabPanelList/TabPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import classNames from 'classnames';

export interface TabPaneProps {
tab?: React.ReactNode;
menuTab?: React.ReactNode;
className?: string;
style?: React.CSSProperties;
disabled?: boolean;
Expand Down