Skip to content

Commit acfd727

Browse files
fhelferthibsy
authored andcommitted
[FIX] #47059 UI: remove MainControls\Slate\Legacy aria-role attribute. (#11014)
* Fixes https://mantis.ilias.de/view.php?id=47059 * Removes the `aria-role` attribute because we cannot safely tell what content is held by a legacy slate. Its content is of type `Component\Legacy` which holds arbitrary HTML.
1 parent 8c4297c commit acfd727

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

components/ILIAS/UI/src/Implementation/Component/MainControls/Renderer.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use ILIAS\UI\Component\MainControls\Footer;
2525
use ILIAS\UI\Component\MainControls\MainBar;
2626
use ILIAS\UI\Component\MainControls\MetaBar;
27+
use ILIAS\UI\Component\MainControls\Slate\Legacy as LegacySlate;
2728
use ILIAS\UI\Component\MainControls\Slate\Slate;
2829
use ILIAS\UI\Component\Signal;
2930
use ILIAS\UI\Implementation\Component\Button\Bulky as IBulky;
@@ -166,7 +167,9 @@ function ($id) use ($js, $mb_id, $k, $is_tool): string {
166167
$tpl->parseCurrentBlock();
167168

168169
if ($slate) {
169-
$entry = $entry->withAriaRole(ISlate::MENU);
170+
if (!$entry instanceof LegacySlate) {
171+
$entry = $entry->withAriaRole(ISlate::MENU);
172+
}
170173

171174
$tpl->setCurrentBlock("slate_item");
172175
$tpl->setVariable("SLATE", $default_renderer->render($entry));

components/ILIAS/UI/tests/Component/MainControls/MainBarTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ public function testRendering(): void
324324
<div class="il-maincontrols-slate disengaged" id="id_10" data-depth-level="1" role="menu">
325325
<div class="il-maincontrols-slate-content" data-replace-marker="content"></div>
326326
</div>
327-
<div class="il-maincontrols-slate disengaged" id="id_13" data-depth-level="1" role="menu">
327+
<div class="il-maincontrols-slate disengaged" id="id_13" data-depth-level="1">
328328
<div class="il-maincontrols-slate-content" data-replace-marker="content">Help</div>
329329
</div>
330330
<div class="il-mainbar-close-slates">

0 commit comments

Comments
 (0)