Skip to content

Commit

Permalink
fix(AttachButton): Hide input from screenreaders (#426)
Browse files Browse the repository at this point in the history
There is a required input for react-dropzone. We should hide it from screenreaders since it's not something users can interact with.
  • Loading branch information
rebeccaalpert authored Feb 7, 2025
1 parent b3af2fd commit daeff64
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export const ChatbotMessageBarDefaultAttachExample: React.FunctionComponent = ()
return (
<>
{/* this is required for react-dropzone to work in Safari and Firefox */}
<input {...getInputProps()} />
<input {...getInputProps()} hidden />
<MessageBar
onSendMessage={handleSend}
attachMenuProps={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ export const AttachmentMenuDemo: React.FunctionComponent = () => {
return (
<>
{/* this is required for react-dropzone to work in Safari and Firefox */}
<input {...getInputProps()} />
<input {...getInputProps()} hidden />
<ChatbotToggle
tooltipLabel="Chatbot"
isChatbotVisible={chatbotVisible}
Expand Down
2 changes: 1 addition & 1 deletion packages/module/src/MessageBar/AttachButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const AttachButtonBase: React.FunctionComponent<AttachButtonProps> = ({
return (
<>
{/* this is required for react-dropzone to work in Safari and Firefox */}
<input data-testid={inputTestId} {...getInputProps()} />
<input data-testid={inputTestId} {...getInputProps()} hidden />
<Tooltip
id="pf-chatbot__tooltip--attach"
content={tooltipContent}
Expand Down

0 comments on commit daeff64

Please sign in to comment.