Skip to content

Redundant ARIA Roles via Delegated Subsections (Moodle 4.5) #54

Description

@paulstevendev

Observed Behavior:
When mod_subsections is active, the Course Index generates redundant role="treeitem" attributes for any subsection. This forces keyboard users to press the arrow keys twice to navigate past a single subsection title.

Investigation / Steps to Reproduce:

Use Moodle 4.5 with Multitopic format.

Observe that standard sections function correctly (single focus stop).

Enable mod_subsections and create a nested subsection.

Navigate the Course Index via keyboard.

Result: The focus manager stops on the core-generated wrapper, then stops again on the plugin-rendered internal div.

Technical Root Cause:
In Moodle 4.5, mod_subsections utilizes the new Delegated Section logic. Core Moodle automatically wraps these delegated components in an

  • with role="treeitem".

    The Multitopic template (templates/core_courseformat/local/courseindex/section.mustache) also applies role="treeitem" and tabindex="-1" to its internal div. This results in invalid nested ARIA roles.

  • Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      No labels
      No labels

      Projects

      No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions