Skip to content

Commit

Permalink
Merge pull request #1063 from DonovanAndrews300/donovan/fixes-ariaCur…
Browse files Browse the repository at this point in the history
…rent-error

Fixes aria error
  • Loading branch information
CodeWritingCow authored Jan 1, 2025
2 parents 8dd910d + 949639f commit a1064f4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/components/ThemeButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ type ButtonProps = Omit<NextUIButtonProps, 'color'> & {
label?: string | React.ReactNode;
color?: 'primary' | 'secondary' | 'tertiary';
isSelected?: boolean;
ariaCurrent?: boolean;
};

type Ref = HTMLButtonElement;
Expand Down Expand Up @@ -94,18 +93,17 @@ const ThemeButton = forwardRef<Ref, ButtonProps>(function ThemeButton(
? `cursor-not-allowed ${removedTransitionStyles}`
: '';
const iconStyles = 'w-5 h-5 text-xl';
const ariaCurrent = isSelected ? { 'aria-current': 'true' } : {};

return (
<NextUIButton
disableRipple={isDisabled}
aria-disabled={isDisabled}
aria-current
onPress={isDisabled ? undefined : onPress}
isIconOnly={iconOnly}
size="md"
className={`${basedStyles} ${colorStyles} ${padding} ${disabledStyles} ${className}`}
ref={ref}
aria-disabled={isDisabled}
ariaCurrent
startContent={
startContent ? (
<span className={iconStyles}>{startContent}</span>
Expand Down

0 comments on commit a1064f4

Please sign in to comment.