From 46f2ea3c1163a5fcc2ba1a8a03955dbe283cfe57 Mon Sep 17 00:00:00 2001 From: Eric Olkowski Date: Fri, 29 Mar 2024 09:57:12 -0400 Subject: [PATCH] Prevented anchor onClick firing for AT --- packages/react-core/src/components/Label/Label.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-core/src/components/Label/Label.tsx b/packages/react-core/src/components/Label/Label.tsx index 3c5eaec6985..8c827374510 100644 --- a/packages/react-core/src/components/Label/Label.tsx +++ b/packages/react-core/src/components/Label/Label.tsx @@ -272,6 +272,8 @@ export const Label: React.FunctionComponent = ({ className: css(styles.labelContent), ...(isTooltipVisible && { tabIndex: 0 }), ...(href && { href }), + // Need to prevent onClick since aria-disabled won't prevent AT from triggering the link + ...(href && isDisabled && { onClick: (event: MouseEvent) => event.preventDefault() }), ...(isButton && clickableLabelProps), ...(isEditable && { ref: editableButtonRef,