Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for disabled elements for screen readers #3268

Open
wants to merge 15 commits into
base: main
Choose a base branch
from

Conversation

jensvannerum
Copy link
Contributor

@jensvannerum jensvannerum commented Aug 27, 2024

References

Add references/links to any related issues or PRs. These may include:

Description

Replaced the html disabled attribute with a custom directive which has the same effect.
The directive is however friendly for screen readers using aria attributes and being focusable with keyboard navigation

Instructions for Reviewers

  • Go to any page that uses a disabled state (e.g login page) and verify behaviour is as expected.
  • Verify the aria-disabled attribute is present on the disabled element for the screen reader

Checklist

This checklist provides a reminder of what we are going to look for when reviewing your PR. You do not need to complete this checklist prior creating your PR (draft PRs are always welcome).
However, reviewers may request that you complete any actions in this list if you have not done so. If you are unsure about an item in the checklist, don't hesitate to ask. We're here to help!

  • My PR is created against the main branch of code (unless it is a backport or is fixing an issue specific to an older branch).
  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes ESLint validation using yarn lint
  • My PR doesn't introduce circular dependencies (verified via yarn check-circ-deps)
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • My PR aligns with Accessibility guidelines if it makes changes to the user interface.
  • My PR uses i18n (internationalization) keys instead of hardcoded English text, to allow for translations.
  • My PR includes details on how to test it. I've provided clear instructions to reviewers on how to successfully test this fix or feature.
  • If my PR includes new libraries/dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.
  • If my PR includes new features or configurations, I've provided basic technical documentation in the PR itself.
  • If my PR fixes an issue ticket, I've linked them together.

@jensvannerum jensvannerum added port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release accessibility labels Aug 27, 2024
@tdonohue tdonohue removed port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release port to dspace-8_x This PR needs to be ported to `dspace-8_x` branch for next bug-fix release labels Aug 27, 2024
Copy link

Hi @jensvannerum,
Conflicts have been detected against the base branch.
Please resolve these conflicts as soon as you can. Thanks!

@tdonohue tdonohue self-requested a review September 12, 2024 15:01
Copy link
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jensvannerum : We gave this a group review in our Developer Meeting today. Overall the feedback was positive, but I've added a few notes inline on issues found during the meeting (and just after the meeting as I scanned it again).

Also noted in the meeting is that we should add a note to our Accessibility documentation guidelines about this new dsDisabled directive (and to avoid using disabled). We have a page with very basic notes in both the 7.x and 8.x docs:

src/app/shared/disabled-directive.ts Outdated Show resolved Hide resolved
src/app/shared/disabled-directive.ts Outdated Show resolved Hide resolved
src/app/shared/disabled-directive.spec.ts Show resolved Hide resolved
@tdonohue tdonohue added the needs documentation PR is missing documentation. All new features and config changes require documentation. label Sep 12, 2024
Jens Vannerum added 4 commits September 16, 2024 10:56
…for-disabled-elements-for-screen-readers-9.0
- added typedocs
- changed directive to only be present for buttons
- various other small fixes
@jensvannerum
Copy link
Contributor Author

@tdonohue Thanks for the feedback, I feel like I addressed all of it.

Note that I also reduced the scope of this PR a little, the directive is currently only present on buttons.
I did this because developers might otherwise expect this to replace the disabled attribute of HTML everywhere, which isn't the case yet. It would disable keystrokes and mouse clicks but wouldn't have the same "disabled look" as the actual HTML attribute gives it (90% usage of the disabled attribute in DSpace is on button anyways so still a huge improvement for accessibility).

Backported changes to 8.x and 7.x PR's too

@jensvannerum jensvannerum force-pushed the w2p-117544_support-for-disabled-elements-for-screen-readers-9.0 branch from fc67065 to c249afd Compare September 18, 2024 11:09
Jens Vannerum added 2 commits September 20, 2024 16:45
… this is only for buttons currently

(cherry picked from commit 2380d4e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility high priority needs documentation PR is missing documentation. All new features and config changes require documentation.
Projects
Status: 👀 Under Review
Development

Successfully merging this pull request may close these issues.

The log in button is not fully accessible to users using a screen reader
2 participants