From 45287b4129af4345556503e0b672bcea94bce543 Mon Sep 17 00:00:00 2001 From: Ashley Harrison Date: Thu, 13 Jan 2022 15:58:21 +0000 Subject: [PATCH] Button: Only set pointer-events: none; on disabled LinkButtons (#44006) --- packages/grafana-ui/src/components/Button/Button.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/grafana-ui/src/components/Button/Button.tsx b/packages/grafana-ui/src/components/Button/Button.tsx index 714808d9b88..d1cf2db8dd4 100644 --- a/packages/grafana-ui/src/components/Button/Button.tsx +++ b/packages/grafana-ui/src/components/Button/Button.tsx @@ -82,7 +82,15 @@ export const LinkButton = React.forwardRef( iconOnly: !children, }); - const linkButtonStyles = cx(styles.button, { [styles.disabled]: disabled }, className); + const linkButtonStyles = cx( + styles.button, + { + [css(styles.disabled, { + pointerEvents: 'none', + })]: disabled, + }, + className + ); deprecatedPropWarning( variant === 'link', @@ -228,7 +236,6 @@ function getPropertiesForDisabled(theme: GrafanaTheme2, variant: ButtonVariant, const disabledStyles: CSSObject = { cursor: 'not-allowed', boxShadow: 'none', - pointerEvents: 'none', color: theme.colors.text.disabled, transition: 'none', };