From bcce0de29c2d9b46f059aa3a5564aa16f336adbc Mon Sep 17 00:00:00 2001 From: abrahammordev Date: Thu, 6 Aug 2026 12:25:11 +0200 Subject: [PATCH 1/3] fix: Add aria-expanded to file controls --- .../Component/Symbol/Glyph/Renderer.php | 10 ++++++++++ .../default/Symbol/tpl.glyph.standard.html | 2 +- .../Component/Input/Field/FileInputTest.php | 16 ++++++++-------- 3 files changed, 19 insertions(+), 9 deletions(-) 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 51d1318e4594..1a73300b96d7 100755 --- a/components/ILIAS/UI/src/Implementation/Component/Symbol/Glyph/Renderer.php +++ b/components/ILIAS/UI/src/Implementation/Component/Symbol/Glyph/Renderer.php @@ -66,6 +66,16 @@ public function render(Component\Component $component, RendererInterface $defaul $tpl = $this->renderLabel($component, $tpl); + if ($component->getType() === Component\Symbol\Glyph\Glyph::EXPAND + || $component->getType() === Component\Symbol\Glyph\Glyph::COLLAPSE) { + $tpl->setCurrentBlock("with_aria_expanded"); + $tpl->setVariable( + "ARIA_EXPANDED", + $component->getType() === Component\Symbol\Glyph\Glyph::COLLAPSE ? "true" : "false" + ); + $tpl->parseCurrentBlock(); + } + $id = $this->bindJavaScript($component); if ($id !== null) { 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..15e1c8bc5397 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}" aria-expanded="{ARIA_EXPANDED}" id="{ID}"> {GLYPH} diff --git a/components/ILIAS/UI/tests/Component/Input/Field/FileInputTest.php b/components/ILIAS/UI/tests/Component/Input/Field/FileInputTest.php index 2b82067e82c8..067913a5e46f 100755 --- a/components/ILIAS/UI/tests/Component/Input/Field/FileInputTest.php +++ b/components/ILIAS/UI/tests/Component/Input/Field/FileInputTest.php @@ -294,12 +294,12 @@ public function testRenderWithMetadata(): void
- + - + @@ -328,10 +328,10 @@ public function testRenderWithMetadata(): void