Skip to content

Commit

Permalink
add role attr to message components
Browse files Browse the repository at this point in the history
  • Loading branch information
ueokande committed Mar 4, 2024
1 parent c5f837c commit e0fd995
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/console/components/ErrorMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ type Props = {
const ErrorMessage: React.FC<Props> = ({ children }) => {
useAutoResize();

return <p {...stylex.props(styles.error)}>{children}</p>;
return (
<p role="alert" {...stylex.props(styles.error)}>
{children}
</p>
);
};

export default ErrorMessage;
6 changes: 5 additions & 1 deletion src/console/components/InfoMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ type Props = {
const InfoMessage: React.FC<Props> = ({ children }) => {
useAutoResize();

return <p {...stylex.props(styles.info)}>{children}</p>;
return (
<p role="status" {...stylex.props(styles.info)}>
{children}
</p>
);
};

export default InfoMessage;

0 comments on commit e0fd995

Please # to comment.