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

Update pagination style and kb navigation for editions table #9883

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

schu96
Copy link
Contributor

@schu96 schu96 commented Sep 17, 2024

Addresses #9853 tasks 1 and 3

Refactor

Technical

Adds a background to pagination button to make it easier for users to see which page they are currently viewing.

Prevents users from tabbing into the a element within the editions table header row, and adds an outline for the currently focused element within the row. Arrow keys left and right can be also used to switch between the two header rows.

Pressing enter within a section of the table header row will now update the arrow indicator for ascending/descending order.

Testing

Go to a works page and scroll down to the editions table.

Verify that the current paginated button has a grey background with black text.

Tab into the editions table header row and use Enter/ArrowLeft/ArrowRight/Tab/Shift + Tab to test added keyboard navigation.

Screenshot

2024-09-17.08-21-20.mp4

Stakeholders

@cdrini

@schu96 schu96 force-pushed the 9853/design/editions-table-pagination-kb-navigation-update branch from 4f909c2 to ef63d42 Compare September 17, 2024 15:39
@schu96 schu96 force-pushed the 9853/design/editions-table-pagination-kb-navigation-update branch from ef63d42 to 40c16b0 Compare September 17, 2024 15:51
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 20 lines in your changes missing coverage. Please review.

Project coverage is 16.35%. Comparing base (ce16a79) to head (40c16b0).
Report is 411 commits behind head on master.

Files with missing lines Patch % Lines
...ary/plugins/openlibrary/js/editions-table/index.js 0.00% 11 Missing and 9 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9883      +/-   ##
==========================================
+ Coverage   16.06%   16.35%   +0.29%     
==========================================
  Files          90       92       +2     
  Lines        4769     4927     +158     
  Branches      832      865      +33     
==========================================
+ Hits          766      806      +40     
- Misses       3480     3576      +96     
- Partials      523      545      +22     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines +44 to +45
$('#editions thead tr th').attr('tabindex', '0');
$('#editions thead tr th a').attr('tabindex', '-1');
Copy link
Collaborator

@cdrini cdrini Sep 19, 2024

Choose a reason for hiding this comment

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

Hmm, would it work if we added the tabindex="-1" to the html here?

<th class="title" title=""><a href="javascript:;">$_('Edition')<span></span></a></th>
<th class="read" title=""><a href="javascript:;">$_('Availability')<span></span></a></th>

If we put it there, I think we won't need the keydown listener, since then the tabbing can behave like the browser default! And since you restored the focus state of the th, it should have the outline and everything!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants