[Resolved] Button Aria Label

Home Forums Support Button Aria Label

  • This topic has 6 replies, 5 voices, and was last updated 2 months ago by Leo.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1346756
    Andy

    Hi, I understand there is an aria-label attribute in the buttons in GenerateBlocks, but can I get some clarification on how to set a label? For example, I know I can add text to a button e.g ‘find out more’, but if I want to use an aria-label for screen reader users such as “Visit the case study page”, how would I go about doing that? I have tried editing the button in html and adding an aria-label but keep getting the following message: “this block contains unexpected or invalid content”.

    #1346847
    David
    Staff
    Customer Support

    Hi there,

    Generally an Aria field is only required if the element doesn’t have a clear label/heading.

    Which is why the Buttons aria field is only available in the Icon settings after an icon is added and the option to hide the text is selected.

    I’ll pass this onto Tom, there may be a filter to display it alway. If there isn’t then you would need to use a HTML block to write your own button.

    #1347315
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    I agree that it should always be an option – even buttons with text can require an aria-label.

    I’ve moved the option into the Advanced panel in 1.1 🙂

    #1347342
    Andy

    That’s fantastic. Thanks Tom!

    #1347507
    Tom
    Lead Developer
    Lead Developer

    No problem! Thanks for the suggestion 🙂

    #1416705
    jose

    Hi! I added manually <button class="menu-toggle" aria-controls="primary-menu" aria-expanded="false" aria-label="top left"> in inc/structure/navigation.php

    How can I use it from child theme?
    In my child theme I create inc/structure/navigation.php but doesnt work. THX

    #1416729
    Leo
    Staff
    Customer Support

    Any chance you can open a new topic for your question?

    Thanks!

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.