mysociety / fixmystreet

This is mySociety's popular map-based reporting platform: easy to install in new countries and regions
http://fixmystreet.org/
Other
501 stars 235 forks source link

Added aria-live search results in around page #4980

Closed lucascumsille closed 1 month ago

lucascumsille commented 1 month ago

Fixes: https://github.com/mysociety/societyworks/issues/4219

This commit helps screen reader to notify the user once the number of results in the map have been updated.

Note:

The reason to not add aria-live="polite" on the js-reports-list that contains messages like 'No reports to show on map, here are some nearby:' is because after testing I realised it also starts reading all the reports found, one by one. So this commit cover cases where:

However it doesn't cover the scenario where: "No reports to show on map, here are some nearby:", because that one is nested inside .js-reports-list and the text is not dynamic, is basically hidden if the condition is not met, therefore aria-live doesn't have an effect. As an idea we could add a screen-reader only label, that gets displayed when there are not results, but there are some nearby. This label would be nested inside .js-pagination and would let the user no "No results found, but there are some nearby reports instead"

[Skip changelog]

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 82.60%. Comparing base (a40ff3f) to head (66d6fd9).

:exclamation: Current head 66d6fd9 differs from pull request most recent head fa8b715

Please upload reports for the commit fa8b715 to get more accurate results.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #4980 +/- ## ========================================== - Coverage 82.60% 82.60% -0.01% ========================================== Files 395 393 -2 Lines 30803 30718 -85 Branches 4884 4866 -18 ========================================== - Hits 25445 25374 -71 + Misses 3910 3895 -15 - Partials 1448 1449 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.