Fixed multiple scrolls appearing on Page when added InfoCard with external bottom link

Signed-off-by: Alex Rybchenko <arybchenko@box.com>
This commit is contained in:
Alex Rybchenko
2022-05-16 17:49:10 +02:00
parent 361cebfe1b
commit c7f32b53a4
2 changed files with 10 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-components': patch
---
Fixed multiple scrolls appearing on Page when added InfoCard with external bottom link
@@ -15,6 +15,7 @@
*/
import { useAnalytics } from '@backstage/core-plugin-api';
import classnames from 'classnames';
import MaterialLink, {
LinkProps as MaterialLinkProps,
} from '@material-ui/core/Link';
@@ -36,6 +37,9 @@ const useStyles = makeStyles(
height: 1,
width: 1,
},
externalLink: {
position: 'relative',
},
},
{ name: 'Link' },
);
@@ -100,6 +104,7 @@ export const Link = React.forwardRef<any, LinkProps>(
onClick={handleClick}
{...(newWindow ? { target: '_blank', rel: 'noopener' } : {})}
{...props}
className={classnames(classes.externalLink, props.className)}
>
{props.children}
<span className={classes.visuallyHidden}>, Opens in a new window</span>