diff --git a/packages/core-components/src/components/OverflowTooltip/OverflowTooltip.stories.tsx b/packages/core-components/src/components/OverflowTooltip/OverflowTooltip.stories.tsx index a302a0a7e3..5ab5ba7dc4 100644 --- a/packages/core-components/src/components/OverflowTooltip/OverflowTooltip.stories.tsx +++ b/packages/core-components/src/components/OverflowTooltip/OverflowTooltip.stories.tsx @@ -33,12 +33,16 @@ export const Default = () => ( export const MultiLine = () => ( - + ); export const DifferentTitle = () => ( - + ); diff --git a/packages/core-components/src/components/OverflowTooltip/OverflowTooltip.tsx b/packages/core-components/src/components/OverflowTooltip/OverflowTooltip.tsx index 12de79644f..ab45d87d33 100644 --- a/packages/core-components/src/components/OverflowTooltip/OverflowTooltip.tsx +++ b/packages/core-components/src/components/OverflowTooltip/OverflowTooltip.tsx @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ /* * Copyright 2020 The Backstage Authors * @@ -23,6 +22,7 @@ import Typography from '@material-ui/core/Typography'; type Props = { text?: string | undefined; title?: TooltipProps['title']; + line?: number | undefined; placement?: TooltipProps['placement']; }; @@ -35,17 +35,18 @@ const useStyles = makeStyles( }, typo: { maxWidth: 200, - display: 'inline-block', overflow: 'hidden', - whiteSpace: 'nowrap', textOverflow: 'ellipsis', + display: '-webkit-box', + '-webkit-line-clamp': ({ line }: Props) => line, + '-webkit-box-orient': 'vertical', }, }, { name: 'BackstageOverflowTooltip' }, ); export function OverflowTooltip(props: Props) { - const classes = useStyles(); + const classes = useStyles(props); return ( ), }; diff --git a/plugins/catalog/src/components/CatalogTable/columns.tsx b/plugins/catalog/src/components/CatalogTable/columns.tsx index d5362badda..5d2f9146d9 100644 --- a/plugins/catalog/src/components/CatalogTable/columns.tsx +++ b/plugins/catalog/src/components/CatalogTable/columns.tsx @@ -141,6 +141,7 @@ export const columnFactories = Object.freeze({ ), width: 'auto',