Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<span class="glyph<!-- BEGIN highlighted --> highlighted<!-- END highlighted --><!-- BEGIN disabled --> disabled<!-- END disabled -->" <!-- BEGIN with_aria_disabled --> aria-disabled="{ARIA_DISABLED}"<!-- END with_aria_disabled --><!-- BEGIN aria_label --> aria-label="{LABEL}"<!-- END aria_label --> role="img"<!-- BEGIN with_id --> id="{ID}"<!-- END with_id -->>
<span class="glyph<!-- BEGIN highlighted --> highlighted<!-- END highlighted --><!-- BEGIN disabled --> disabled<!-- END disabled -->" <!-- BEGIN with_aria_disabled --> aria-disabled="{ARIA_DISABLED}"<!-- END with_aria_disabled --><!-- BEGIN aria_label --> aria-label="{LABEL}"<!-- END aria_label --><!-- BEGIN with_role --> role="{ROLE}"<!-- END with_role --><!-- BEGIN with_id --> id="{ID}"<!-- END with_id -->>
{GLYPH}
</span>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<a <!-- BEGIN tabbable -->tabindex="0" <!-- END tabbable -->class="glyph<!-- BEGIN highlighted --> highlighted<!-- END highlighted --><!-- BEGIN disabled --> disabled<!-- END disabled -->"<!-- BEGIN with_action --> href="{ACTION}"<!-- END with_action --> aria-label="{LABEL}"<!-- BEGIN with_aria_disabled --> aria-disabled="{ARIA_DISABLED}"<!-- END with_aria_disabled --><!-- BEGIN with_id --> id="{ID}"<!-- END with_id -->>
<a<!-- BEGIN tabbable --> tabindex="0"<!-- END tabbable --> class="glyph<!-- BEGIN highlighted --> highlighted<!-- END highlighted --><!-- BEGIN disabled --> disabled<!-- END disabled -->"<!-- BEGIN with_action --> href="{ACTION}"<!-- END with_action --> aria-label="{LABEL}"<!-- BEGIN with_aria_disabled --> aria-disabled="{ARIA_DISABLED}"<!-- END with_aria_disabled --><!-- BEGIN with_role --> role="{ROLE}"<!-- END with_role --><!-- BEGIN with_id --> id="{ID}"<!-- END with_id -->>
{GLYPH}
</a>
Loading