question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Aria-Label: change `{title} expand` to `expand {title}`

See original GitHub issue

Summary

change order of words in aria label

Basic example

https://github.com/gatsbyjs/gatsby/blob/e36d73157e5964267fbcc62ed3b2d0e2582b735e/www/src/components/sidebar/section-title.js#L169-L172

 aria-label={ 
   isExpanded 
     ? i18n._(t`collapse ${item.title}`) 
     : i18n._(t`expand ${item.title}`) 

Motivation

when there are long titles then i guess it is better when the important part comes first when the voicereader say the label.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
capndavecommented, May 13, 2020

Madalyn - what a great and thorough insight/explanation! I’ll make the changes you suggested to this pr and open a new one for the item.table issue with aria-label. Best, -Dave

On Tue, May 12, 2020, 2:39 PM Madalyn notifications@github.com wrote:

Hi there, @muescha https://github.com/muescha and @capndave https://github.com/capndave! I really appreciate the passion for accessibility!

That said, after consulting prior art around expand/collapse functionality, including the WAI-ARIA best practices https://www.w3.org/TR/wai-aria-practices/examples/accordion/accordion.html, I’ve found that ${title} expanded/collapsed is how assistive technology interprets toggle button behavior using aria-expanded and since that is the behavior we are implementing in this component, we should be consistent with that behavior.

Upon further investigation, it looks like having expand or collapse in that string is redundant to the aria-expanded attribute, meaning that assistive technology would read “${item.title} collapse, expanded” for example.

[image: VoiceOver UI shows “{0} collapse, expanded, button”] https://user-images.githubusercontent.com/3230904/81737407-0cc47c80-9466-11ea-940d-aab0c2bacf49.png

I recommend that instead of reordering words that we remove expand’ and collapsedfrom the label entirely and letaria-expanded` denote current state itself.

Additionally, it looks like item.title isn’t properly making it into the aria-label. If you’d like to tackle that in this PR that’d be awesome but I can also open a separate issue if you’d like to leave this scoped to handling expanded state. Thank you so much for your contribution!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/gatsbyjs/gatsby/issues/23948#issuecomment-627551062, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADTOOZP4QWTH3FNNNKHNOU3RRGQXNANCNFSM4M45IDJA .

2reactions
capndavecommented, May 9, 2020

I’d like to work on this if @muescha is not already working on it! I haven’t contributed to Gatsby yet so please let me know if there is a particular protocol to follow for checking out issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to change the aria-label on Expand and Collapse Details ...
I have solved it now (not nice, but rare). I assume that all rows are collapsed when initializing. I add aria-expanded = "false"...
Read more >
Using the WAI-ARIA aria-expanded state to mark expandable ...
Content using WAI-ARIA that contains expandable and collapsible regions. This technique relates to. ensure-compat-rsv: 4.1.2 Name, Role, Value (sufficient) ...
Read more >
aria-expanded - Accessibility - MDN Web Docs - Mozilla
The aria-expanded attribute is set on an element to indicate if a control is ... name of the controlling object should reflect this...
Read more >
Replace all title= attributes with aria-label= (D8) - Drupal
Proposed resolution Change all "title" attributes to "aria-label". Remaining tasks Make the changes. ... Download & Extend.
Read more >
ARIA labels and relationships - web.dev
aria-label allows us to specify a string to be used as the ... Importantly, aria-labelledby overrides all other name sources for an element....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found