Fix OverflowTooltip cutting of the bottom of letters like "g" and "y"

Signed-off-by: Oliver Sand <oliver.sand@sda-se.com>
This commit is contained in:
Oliver Sand
2021-02-19 18:00:42 +01:00
parent 6c09312dca
commit e799e74d4e
2 changed files with 14 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core': patch
---
Fix `OverflowTooltip` cutting off the bottom of letters like "g" and "y".
@@ -14,7 +14,7 @@
* limitations under the License.
*/
import { Tooltip, TooltipProps } from '@material-ui/core';
import { makeStyles, Tooltip, TooltipProps } from '@material-ui/core';
import React, { useState } from 'react';
import TextTruncate, { TextTruncateProps } from 'react-text-truncate';
@@ -26,8 +26,15 @@ type Props = {
placement?: TooltipProps['placement'];
};
const useStyles = makeStyles({
container: {
overflow: 'visible !important',
},
});
export const OverflowTooltip = (props: Props) => {
const [hover, setHover] = useState(false);
const classes = useStyles();
const handleToggled = (truncated: boolean) => {
setHover(truncated);
@@ -43,6 +50,7 @@ export const OverflowTooltip = (props: Props) => {
text={props.text}
line={props.line}
onToggled={handleToggled}
containerClassName={classes.container}
/>
</Tooltip>
);