Skip to content

Fix truncatable-part keyboard accessibility#3212

Merged
tdonohue merged 1 commit intoDSpace:mainfrom
autavares-dev:fix-truncatable-part-keyboard-accessibility
Jan 24, 2025
Merged

Fix truncatable-part keyboard accessibility#3212
tdonohue merged 1 commit intoDSpace:mainfrom
autavares-dev:fix-truncatable-part-keyboard-accessibility

Conversation

@autavares-dev
Copy link
Contributor

References

Fixes #3073

Description

Fixes keyboard shortcuts of the truncatable-part component, used in the 'Show more' button.

Instructions for Reviewers

  • Go to a page that lists items, such as the home page or a search, with at least one of the items having content long enough for the "Show More" button to be displayed.
  • Click anywhere in a blank area near the item list. Cycle through the DOM elements using the TAB key.
  • When the 'Show More'/'Collapse' button is highlighted, you can toggle it using the Enter key or the spacebar.
  • Button still works using the mouse

List of changes in this PR:

  • truncatable-part.component.html:
    • Refactored/simplified the 'Show more' and 'Collapse' buttons into a single button element
    • Added event bindings for the enter key and the spacebar
    • Added aria-expanded

Checklist

  • 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.

@tdonohue tdonohue added bug accessibility 1 APPROVAL pull request only requires a single approval to merge 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 Jul 23, 2024
@michdyk michdyk self-requested a review October 10, 2024 12:01
@michdyk michdyk requested review from macieki and removed request for michdyk December 6, 2024 13:55
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.

👍 Thanks @autavares-dev ! I finally got around to testing this today and it fixes the keyboard accessibility & also adds an aria-expanded. This looks good to me.

@tdonohue tdonohue merged commit 65e1b8e into DSpace:main Jan 24, 2025
@tdonohue tdonohue added this to the 9.0 milestone Jan 24, 2025
@dspace-bot
Copy link
Contributor

Successfully created backport PR for dspace-7_x:

@dspace-bot
Copy link
Contributor

Successfully created backport PR for dspace-8_x:

@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 Jan 24, 2025
@autavares-dev autavares-dev deleted the fix-truncatable-part-keyboard-accessibility branch December 6, 2025 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 APPROVAL pull request only requires a single approval to merge accessibility bug

Projects

No open projects
Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Accessibility Issue: keyboard-only users cannot interact with "show more"

3 participants