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

2251 accessibility issues on the community list page #2447

Conversation

J4bbi
Copy link
Contributor

@J4bbi J4bbi commented Aug 22, 2023

References

Description

Cdk-tree was re-rendering itself completely on each datasource change because no trackBy function had been defined. It could not establish what was new and what was old. So a quick win :)

Instructions for Reviewers

Build the front end and expand communities and collections on the community list page and contrast with https://demo7.dspace.org/community-list

List of changes in this PR:

  • trackBy method for cdk-tree
  • minor styling changes

@tdonohue tdonohue added the port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release label Aug 22, 2023
@tdonohue tdonohue added this to the 7.6.1 milestone Aug 22, 2023
@tdonohue tdonohue added the 1 APPROVAL pull request only requires a single approval to merge label Aug 22, 2023
@tdonohue tdonohue self-requested a review August 24, 2023 14:52
@alanorth
Copy link
Contributor

Thanks @J4bbi. I tested this patch. The stylistic changes seem sane and don't affect the UI presentation significantly, but should improve screen reader's ability to parse the tree.

Regarding the cdk-tree trackBy changes, I can't see any difference in testing. How can I tell that the tree is re-rendering every time? Is this something that is perceivable visually like a flicker when expanding communities and collections, or just makes it slow? Thanks!

@J4bbi
Copy link
Contributor Author

J4bbi commented Aug 28, 2023

Thanks for taking the time to review this @alanorth .

When the cd-tree is loaded on first arriving at https://demo.dspace.org/community-list, everything is fine:

2023-08-28_14-08

If you then click to expand the node, it will set the focus:

2023-08-28_14-11

The focus will remain momentarily while the API call is made to establish the children nodes. But the focus will then be dropped because to cdk-tree entirely new data is being loaded, not the same data with some more added.

2023-08-28_14-16

I've had to use a different example for how the patch works because the demo server has been switched to https://sandbox.dspace.org

2023-08-28_14-38

Hope that makes it clear?

This is trackBy analogous to d3's key function in binding data if you're familiar with D3.

@alanorth
Copy link
Contributor

alanorth commented Aug 28, 2023

Thanks, @J4bbi. I see what you mean now. Current behavior without the patch, I see aria-expanded="false" on the cdk-tree element and then it flashes aria-expanded="true" briefly when I expand the node, and then the attribute disappears entirely.

With the patch I verified that the aria-expanded attribute is persistent with the correct state on each cdk-tree node when expanding and collapsing. Looks good to me!

@alanorth alanorth self-requested a review August 28, 2023 14:42
@alanorth alanorth merged commit 6c4cfe5 into DSpace:main Aug 28, 2023
10 checks passed
@dspace-bot
Copy link
Contributor

Successfully created backport PR for dspace-7_x:

@tdonohue tdonohue removed the port to dspace-7_x This PR needs to be ported to `dspace-7_x` branch for next bug-fix release label Aug 28, 2023
@tdonohue tdonohue modified the milestones: 7.6.1, 8.0 Aug 28, 2023
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 component: Community Community display or editing
Projects
No open projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

Accessibility issues on the community-list page
4 participants