Skip to content

Commit

Permalink
Use role "alert" on form feedback messages when changing user password
Browse files Browse the repository at this point in the history
This way, if the user is using a screen reader, they will be notified
about the feedback messages as they appear.
  • Loading branch information
Adamik10 committed Oct 13, 2023
1 parent f00b79c commit 7a50585
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/apps/patron-page/PatronPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const PatronPage: FC = () => {
)}
{patron && <PincodeSection changePincode={setPin} required={false} />}
{successPinMessage && (
<p className="text-body-small-regular mb-8 mt-8">
<p className="text-body-small-regular mb-8 mt-8" role="alert">
{successPinMessage}
</p>
)}
Expand Down
6 changes: 5 additions & 1 deletion src/components/atoms/input/TextInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,11 @@ const TextInput: FC<TextInputProps> = ({
</div>
)}
{validation && (
<div id={`validation-${id}`} className="dpl-input__validation">
<div
id={`validation-${id}`}
className="dpl-input__validation"
role="alert"
>
{validation}
</div>
)}
Expand Down

0 comments on commit 7a50585

Please sign in to comment.