Skip to content

Conversation

@DanBloxham-sw
Copy link
Contributor

@DanBloxham-sw DanBloxham-sw commented Feb 11, 2022

JIRA link

https://softwiretech.atlassian.net/browse/HEEDLS-761

Description

Tackled the comments in the ticket so that the page number is announced when loading the page, and the matching result count is not read out twice. This does impact how things are announced in other circumstances, which I have detailed on comments at the relevant changes. Do let me know if we think any of these side effects should be avoided.

Screenshots

N/A


Developer checks

(Leave tasks unticked if they haven't been appropriate for your ticket.)

I have:

  • Run the formatter and made sure there are no IDE errors.
  • Written tests for the changes (accessibility tests, unit tests for controller, data services, services, view models, etc)
  • Manually tested my work with and without JavaScript. Full manual testing guidelines can be found here: https://softwiretech.atlassian.net/wiki/spaces/HEE/pages/6703648740/Testing
  • Updated/added documentation in Swiki and/or Readme. Links (if any) are below:
  • Updated my Jira ticket with information about other parts of the system that were touched as part of the MR and have to be sanity tested to ensure nothing’s broken.
  • Scanned over my own MR to ensure everything is as expected.

Comment on lines +111 to +114
if (updateResultCount) {
const resultCount = sortedUniqueElements.length;
SearchSortFilterAndPaginate.updateResultCount(resultCount);
}
Copy link
Contributor Author

@DanBloxham-sw DanBloxham-sw Feb 11, 2022

Choose a reason for hiding this comment

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

This has been performed so that the result count is not updated when updateResultCount is false. It is only set to false in the constructor when the page is initially loading. This prevents the result count being announced twice on any page load when JS is enabled.

The reason for this is twofold:

  1. When we hit this in the constructor, the page should already have its result count set from the basic GET request (the same that occurs without JS). This shouldn't need to change when JS loads its data, so this is unnecessary to run.
  2. The result count was being read out twice on page load because the result count has an alert role. It was read out when the page was initially displayed, and then read out again when the JS loading updated it to the same value. Normally, alerts do not get announced if the text inside is updated to the exact same value. However, we add a non-breaking space to any text value that is identical when updating in HEEDLS-585 - fix inconsistent announcement of result counts #648 to prevent the screen reader from remaining silent when searching for something that does not change the number of results.

Copy link
Contributor

@livzorn livzorn left a comment

Choose a reason for hiding this comment

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

Looks great to me :)

@DanBloxham-sw DanBloxham-sw merged commit e69dd51 into release-22.2.1 Feb 15, 2022
@DanBloxham-sw DanBloxham-sw deleted the HEEDLS-761-FixScreenReaderPageNumberAndResultCountAnnouncement branch February 15, 2022 09:11
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.

4 participants