Skip to content

[TR] A11y: Clear purpose & user instructions: Editable Risk Profile form unconditionally announces "View information (read-only)" via visually-hidden text on the Risk Assessment page - #1681

Open
sofyakurilova wants to merge 1 commit into
devfrom
bug/a11y/risk_assessment

Conversation

@sofyakurilova

Copy link
Copy Markdown
Collaborator

fix(ui): stop announcing editable risk profile form as read-only

  • Replace the hidden <span id="form-accessible-title"> in ProfileFormComponent, which always read "View information (read-only)", with a visually hidden <h2> whose text reflects the form's actual mode: "Create risk profile" (new profile or unsaved copy), "Edit risk profile" (draft or valid profile), or "View information (read-only)" (expired profile).
  • Always reference the heading from <form class="profile-form"> via aria-labelledby, instead of only for expired profiles, so the form is exposed as a named form landmark.
  • Add an isReadOnly getter and use it for the heading text, the profile-form-outdated class, the form tabindex, and the delayed enable/disable of the controls, so the announced mode always matches the controls' disabled state.
  • Add unit tests covering the heading semantics and aria-labelledby link, the title for new, copied, valid, draft, and expired profiles, and "read-only" being announced only when the controls are disabled.

- Replace the hidden `<span id="form-accessible-title">` in
  `ProfileFormComponent`, which always read "View information (read-only)",
  with a visually hidden `<h2>` whose text reflects the form's actual mode:
  "Create risk profile" (new profile or unsaved copy), "Edit risk profile"
  (draft or valid profile), or "View information (read-only)" (expired
  profile).
- Always reference the heading from `<form class="profile-form">` via
  `aria-labelledby`, instead of only for expired profiles, so the form is
  exposed as a named form landmark.
- Add an `isReadOnly` getter and use it for the heading text, the
  `profile-form-outdated` class, the form `tabindex`, and the delayed
  enable/disable of the controls, so the announced mode always matches the
  controls' disabled state.
- Add unit tests covering the heading semantics and `aria-labelledby` link,
  the title for new, copied, valid, draft, and expired profiles, and
  "read-only" being announced only when the controls are disabled.
@sofyakurilova
sofyakurilova requested a review from hitnik November 3, 2026 15:34
@sofyakurilova sofyakurilova added the a11y Fix related to accessibility label Nov 3, 2026
@sofyakurilova sofyakurilova added this to the Release 2.4.2 milestone Nov 3, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a11y Fix related to accessibility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant