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

Fix the timestamp in the screen reader narrative for current conditions #1029

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

greg-does-weather
Copy link
Collaborator

What does this PR do? 🛠️

The timestamp in the screen reader narrative section of the current conditions component did not get updated when we switched how we do time localization. This PR fixes that.

Note

VoiceOver treats inline elements (like span or time) as independent blocks when reading them, so users must navigate to them individually. We cannot get around this. In Safari, adding role="text" to the container element will force VoiceOver to treat it as a single block of text, but that's a nonstandard role and is ignored by all other browsers.

I only have access to VoiceOver, so I cannot test this behavior with other screen readers, unfortunately, but the internet seems to think it should work as expected with them. VoiceOver is the oddball.

Comment on lines -17 to +23
{{ content.temperature }}<span aria-hidden="true" class="font-body-xs display-inline-block left-full margin-top-05 margin-left-neg-2px">&deg;F</span>
<span class="usa-sr-only">℉</span>
{{ content.temperature }}<span class="font-body-xs display-inline-block left-full margin-top-05 margin-left-neg-2px">&deg;F</span>
</div>
<div class="margin-top-05 position-relative">
<div class="font-mono-2xs font-family-mono text-base text-uppercase">{{ "Feels like" | t }}</div>
<div class="text-primary-darker">
<p class="margin-top-2px font-body-md">{{ content.feels_like }}
<span aria-hidden="true" class="font-body-3xs position-absolute margin-top">&deg;F</span>
<span class="usa-sr-only">℉</span>
<p class="margin-top-2px font-body-md">
{{ content.feels_like }}<span class="font-body-3xs position-absolute margin-top">&deg;F</span>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We don't need screen reader-specific handling here because these entire blocks are hidden from screen readers.

Copy link
Collaborator

@eric-gade eric-gade left a comment

Choose a reason for hiding this comment

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

Short comment here b/c this looks good on my end 👍

@greg-does-weather greg-does-weather added this pull request to the merge queue Apr 15, 2024
Merged via the queue into main with commit 814f344 Apr 15, 2024
11 checks passed
@greg-does-weather greg-does-weather deleted the mgwalker/1016-time branch April 15, 2024 14:32
This pull request was closed.
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.

Accessibility: Screenreader reads off GMT+0000 within Current Conditions
2 participants