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

[BITV] Full date can be shown after headings like "Today" as a hidden-visually span #1019

Closed
Tracked by #898
JuliaKirschenheuter opened this issue Dec 1, 2022 · 3 comments · Fixed by #1065
Closed
Tracked by #898
Assignees

Comments

@JuliaKirschenheuter
Copy link
Contributor

No description provided.

@JuliaKirschenheuter JuliaKirschenheuter self-assigned this Dec 1, 2022
@PVince81 PVince81 changed the title Full date can be shown after headings like "Today" as a hidden-visually span [BITV] Full date can be shown after headings like "Today" as a hidden-visually span Dec 1, 2022
@JuliaKirschenheuter
Copy link
Contributor Author

Currently headings are inside of <span> which is inside of <h2>. Custom tooltip with full data is inside of an attr data-original-title. Since custom tooltips will be replaced with native tooltips:

  1. full data will be moved to title attr.
  2. full data will be placed in aria-label inside of <h2>
  3. <span> isn't needed and will be removed.

All this work will be done in #1045

Closing a "duplicate".

@JuliaKirschenheuter
Copy link
Contributor Author

Hello @michaelnissenbaum,

could you please tell me: is it correct to place a full data in aria-label attr and at the same time place relative date (7 min ago) inside of a <span>?

Screenshot from 2023-01-26 14-35-08

Screenshot from 2023-01-26 14-35-42

Or should be instead of it an exact visually-hidden <span>? Thank you!

@michaelnissenbaum
Copy link

michaelnissenbaum commented Jan 26, 2023

The aria-label attribute is sometimes ignored by some assistive technology (screen reader) if the element you put it on doesn't have any semantic meaning. And in your example you use a span element which doesn't have semantic meaning. See https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-label for more details.
In your case my proposal will be as followed:

<span class="sr-only">January 26, 2023, 2:28 PM</span>
<span>7 minutes ago</span>

Class sr-only just visually hide the text making it only available for screen reader users. See https://www.tpgi.com/the-anatomy-of-visually-hidden/.

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

Successfully merging a pull request may close this issue.

2 participants