Skip to content

Commit

Permalink
enhance Tab suppoprt for popup menu (#879)
Browse files Browse the repository at this point in the history
  • Loading branch information
heswell authored Sep 18, 2023
1 parent 15e4a1a commit bd628f3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion vuu-ui/packages/vuu-ui-controls/src/tabstrip/Tab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const Tab = forwardRef(function Tab(
onMenuClose,
orientation,
selected,
showMenuButton = closeable || editable,
showMenuButton = closeable || editable || Boolean(location),
tabIndex,
...props
}: TabProps,
Expand Down
4 changes: 2 additions & 2 deletions vuu-ui/packages/vuu-ui-controls/src/tabstrip/TabsTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export interface TabstripProps extends HTMLAttributes<HTMLDivElement> {
editing?: boolean;
keyBoardActivation?: "manual" | "automatic";
/**
* A custom context menu location for TabMenu
* A custom context menu location for TabMenu, applied to all tabs
*/
location?: string;
/**
Expand Down Expand Up @@ -108,7 +108,7 @@ export interface TabstripProps extends HTMLAttributes<HTMLDivElement> {
promptForNewTabName?: boolean;
/**
* Should each tab render a popup menu. Default is false if tab is
* not closeable or renameable, otherwise true.
* not closeable, not renameable and has no tab-location , otherwise true.
*/
showTabMenuButton?: boolean;
}
Expand Down
3 changes: 2 additions & 1 deletion vuu-ui/packages/vuu-ui-controls/src/tabstrip/Tabstrip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export const Tabstrip = ({
id: tabId = `${id}-tab-${index}`,
closeable = allowCloseTab,
editable = allowRenameTab,
location: tabLocation,
showMenuButton = showTabMenuButton,
} = child.props;
const selected = index === activeTabIndex;
Expand All @@ -86,7 +87,7 @@ export const Tabstrip = ({
id: tabId,
index,
key: index,
location,
location: cx(location, tabLocation),
selected,
showMenuButton,
tabIndex: selected ? 0 : -1,
Expand Down

0 comments on commit bd628f3

Please sign in to comment.