Skip to content

Commit

Permalink
fix: remove redundant aria-describedby attributes (#243)
Browse files Browse the repository at this point in the history
* fix: remove redundant aria-describedby attributes

* Update packages/module/src/ResponseActions/ResponseActionButton.tsx

Co-authored-by: Rebecca Alpert <[email protected]>

---------

Co-authored-by: Rebecca Alpert <[email protected]>
  • Loading branch information
nicolethoen and rebeccaalpert authored Oct 16, 2024
1 parent 3741773 commit 6ea3950
Show file tree
Hide file tree
Showing 7 changed files with 2 additions and 9 deletions.
1 change: 0 additions & 1 deletion packages/module/src/ChatbotHeader/ChatbotHeaderMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export const ChatbotHeaderMenu: React.FunctionComponent<ChatbotHeaderMenuProps>
<Button
className="pf-chatbot__button--toggle-menu"
variant="plain"
aria-describedby="pf-chatbot__tooltip--toggle-menu"
onClick={onMenuToggle}
aria-label={menuAriaLabel}
icon={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ const CodeBlockMessage = ({ children, className, ...props }: JSX.IntrinsicElemen
aria-label="Copy code button"
variant="plain"
className="pf-chatbot__button--copy"
aria-describedby={tooltipID}
onClick={(event) => handleCopy(event, children)}
>
{copied ? <CheckIcon /> : <CopyIcon />}
Expand Down
1 change: 0 additions & 1 deletion packages/module/src/MessageBar/AttachButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ const AttachButtonBase: React.FunctionComponent<AttachButtonProps> = ({
variant="plain"
ref={innerRef}
className={`pf-chatbot__button--attach ${className ?? ''}`}
aria-describedby="pf-chatbot__tooltip--attach"
aria-label={props['aria-label'] || 'Attach Button'}
isDisabled={isDisabled}
onClick={onClick ?? open}
Expand Down
1 change: 0 additions & 1 deletion packages/module/src/MessageBar/MicrophoneButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export const MicrophoneButton: React.FunctionComponent<MicrophoneButtonProps> =
<Button
variant="plain"
className={`pf-chatbot__button--microphone ${isListening ? 'pf-chatbot__button--microphone--active' : ''} ${className ?? ''}`}
aria-describedby="pf-chatbot__tooltip--use-microphone"
aria-label={props['aria-label'] || 'Microphone Button'}
onClick={isListening ? stopListening : startListening}
icon={
Expand Down
1 change: 0 additions & 1 deletion packages/module/src/MessageBar/SendButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export const SendButton: React.FunctionComponent<SendButtonProps> = ({
<Button
className={`pf-chatbot__button--send ${className ?? ''}`}
variant="link"
aria-describedby="pf-chatbot__tooltip--send"
aria-label={props['aria-label'] || 'Send Button'}
onClick={onClick}
icon={
Expand Down
1 change: 0 additions & 1 deletion packages/module/src/MessageBox/JumpButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const JumpButton: React.FunctionComponent<JumpButtonProps> = ({ position, isHidd
variant="plain"
className={`pf-chatbot__jump pf-chatbot__jump--${position} ${isHidden && `pf-chatbot__jump--${position}--hidden`}`}
aria-label={`Jump ${position} button`}
aria-describedby={`pf-chatbot__tooltip--jump-${position}`}
onClick={onClick}
>
<Icon iconSize="xl" isInline>
Expand Down
5 changes: 2 additions & 3 deletions packages/module/src/ResponseActions/ResponseActionButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import { Button, Icon, Tooltip, TooltipProps } from '@patternfly/react-core';

export interface ResponseActionButtonProps {
/** Aria-label for the button */
/** Aria-label for the button. Defaults to the value of the tooltipContent if none provided */
ariaLabel?: string;
/** Icon for the button */
icon: React.ReactNode;
Expand Down Expand Up @@ -40,8 +40,7 @@ export const ResponseActionButton: React.FunctionComponent<ResponseActionButtonP
<Button
variant="plain"
className={`pf-chatbot__button--response-action ${className ?? ''}`}
aria-describedby={`pf-chatbot__tooltip-response-action-${tooltipContent}`}
aria-label={ariaLabel}
aria-label={ariaLabel || tooltipContent}
icon={
<Icon isInline size="lg">
{icon}
Expand Down

0 comments on commit 6ea3950

Please sign in to comment.