diff --git a/components/ILIAS/UI/src/Implementation/Component/Symbol/Glyph/Renderer.php b/components/ILIAS/UI/src/Implementation/Component/Symbol/Glyph/Renderer.php index 83195849394c..9f0e3b35147e 100755 --- a/components/ILIAS/UI/src/Implementation/Component/Symbol/Glyph/Renderer.php +++ b/components/ILIAS/UI/src/Implementation/Component/Symbol/Glyph/Renderer.php @@ -67,6 +67,16 @@ public function render(Component\Component $component, RendererInterface $defaul $tpl->parseCurrentBlock(); } + $has_action = $component->isActive() && ($component->getAction() !== ''); + $is_clickable = $component->isTabbable() || ($component instanceof Component\Triggerer && count($component->getTriggeredSignals()) > 0); + + if (!$has_action) { + $role = $is_clickable ? 'button' : 'img'; + $tpl->setCurrentBlock("with_role"); + $tpl->setVariable("ROLE", $role); + $tpl->parseCurrentBlock(); + } + $tpl = $this->renderLabel($component, $tpl); $id = $this->bindJavaScript($component); diff --git a/components/ILIAS/UI/src/templates/default/Symbol/tpl.glyph.context_btn.html b/components/ILIAS/UI/src/templates/default/Symbol/tpl.glyph.context_btn.html index c36bf807c5c1..fbde6217c88f 100755 --- a/components/ILIAS/UI/src/templates/default/Symbol/tpl.glyph.context_btn.html +++ b/components/ILIAS/UI/src/templates/default/Symbol/tpl.glyph.context_btn.html @@ -1,3 +1,3 @@ - aria-disabled="{ARIA_DISABLED}" aria-label="{LABEL}" role="img" id="{ID}"> + aria-disabled="{ARIA_DISABLED}" aria-label="{LABEL}" role="{ROLE}" id="{ID}"> {GLYPH} diff --git a/components/ILIAS/UI/src/templates/default/Symbol/tpl.glyph.standard.html b/components/ILIAS/UI/src/templates/default/Symbol/tpl.glyph.standard.html index 7da77fabbc12..607c04cf017a 100755 --- a/components/ILIAS/UI/src/templates/default/Symbol/tpl.glyph.standard.html +++ b/components/ILIAS/UI/src/templates/default/Symbol/tpl.glyph.standard.html @@ -1,3 +1,3 @@ -tabindex="0" class="glyph highlighted disabled" href="{ACTION}" aria-label="{LABEL}" aria-disabled="{ARIA_DISABLED}" id="{ID}"> + tabindex="0" class="glyph highlighted disabled" href="{ACTION}" aria-label="{LABEL}" aria-disabled="{ARIA_DISABLED}" role="{ROLE}" id="{ID}"> {GLYPH}