[beta5] Side-menu : replace aria-label by aria-labelledby (1.8 changelog)

Created on 27 September 2023, 9 months ago
Updated 7 October 2023, 9 months ago

Problem/Motivation

According to DSFR 1.8 changelog for side-menu : the aria-label attribute on the nav should be replaced by aria-labelledby pointing to the title.
https://github.com/GouvernementFR/dsfr/releases/tag/v1.8.0
https://www.systeme-de-design.gouv.fr/elements-d-interface/composants/me...

This will require a unique id for sidemenu__title.

πŸ› Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @mh_nichts
  • Status changed to Needs review 9 months ago
  • πŸ‡¦πŸ‡·Argentina tguerineau

    I have created a patch to address the issue of replacing the aria-label attribute with aria-labelledby on the nav element of the side menu, as per the DSFR 1.8 changelog. The patch includes a unique ID for sidemenu__title which is then referenced by aria-labelledby in the nav element.

    In my local environment, it appears that the block--system-menu-block.html.twig template from the core system module is being used instead of the pattern-side-menu.twig template from the ui_suite_dsfr theme. I have created the patch based on the assumption that the pattern-side-menu.twig template should be used.

    I am not entirely sure if there's additional configuration needed to ensure the pattern-side-menu.twig template is used, so any feedback or testing from others would be greatly appreciated.

    Attached is the patch for review and testing.

  • Status changed to Needs work 9 months ago
  • πŸ‡«πŸ‡·France pdureau Paris

    Hello Tom'as,

    Thanks for your contribution. Can you do a MR instead of a patch?

    About: {% set title_id = 'sidemenu__title-' ~ random() %}

    Can you:

    • expose title_id as a pattern setting in the definition file?
          title_id:
            type: token
            label:Title  ID
            description: "Must start with a letter. Randomly generated if empty."
    • wrap this into a default() filter: {% set title_id = title_id|default('sidemenu__title-' ~ random()) %}

    See πŸ“Œ [beta4] Always use default() filter with random function() Fixed

    Where do you use title_id? If you "call" it from aria-labelledby I guess you need to "declare" it somewhere, isn't it?

  • Status changed to Needs review 9 months ago
  • πŸ‡¦πŸ‡·Argentina tguerineau

    @pdureau Thank you for your detailed feedback and guidance. I've made adjustments based on your comments and suggestions:

    1. Pattern Setting for title_id: title_id has been exposed as a pattern setting within the pattern definition file, allowing developers to understand and utilize it effectively.

    2. Usage of default() filter with random() function: The default() filter has been applied to title_id, adhering to the best practices outlined in issue #3380233.

    3. Declaration and Usage of title_id: title_id is utilized in aria-labelledby and declared appropriately within the HTML structure to enhance accessibility.

    These changes have been committed and pushed to the issue fork for review and testing.

  • @tguerineau opened merge request.
  • Status changed to Fixed 9 months ago
  • πŸ‡«πŸ‡·France pdureau Paris

    Merged. Thanks

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024