Skip to content

Commit

Permalink
Prevented anchor onClick firing for AT
Browse files Browse the repository at this point in the history
  • Loading branch information
thatblindgeye committed Mar 29, 2024
1 parent 700dc45 commit 46f2ea3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/react-core/src/components/Label/Label.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,8 @@ export const Label: React.FunctionComponent<LabelProps> = ({
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,
Expand Down

0 comments on commit 46f2ea3

Please sign in to comment.