diff --git a/course/classes/management_renderer.php b/course/classes/management_renderer.php index 3de3c7a5bbf..08373bc9220 100644 --- a/course/classes/management_renderer.php +++ b/course/classes/management_renderer.php @@ -378,6 +378,10 @@ class core_course_management_renderer extends plugin_renderer_base { if (!$hasitems) { return ''; } + + // If the action menu has items, add the menubar role to the main element containing it. + $menu->attributes['role'] = 'menubar'; + return $this->render($menu); } diff --git a/lib/outputcomponents.php b/lib/outputcomponents.php index 1c962d78a3b..cea427f26cd 100644 --- a/lib/outputcomponents.php +++ b/lib/outputcomponents.php @@ -4237,7 +4237,6 @@ class action_menu implements renderable, templatable { $this->attributesprimary = array( 'id' => 'action-menu-'.$this->instance.'-menubar', 'class' => 'menubar', - 'role' => 'menubar' ); $this->attributessecondary = array( 'id' => 'action-menu-'.$this->instance.'-menu',