Skip to content
Snippets Groups Projects
Commit cea74f15 authored by Elmar Ludwig's avatar Elmar Ludwig Committed by David Siegfried
Browse files

stop overriding the button focus outline, fixes #1304

Closes #1304

Merge request studip/studip!800
parent b6f711b6
No related branches found
No related tags found
No related merge requests found
Pipeline #5168 passed
......@@ -36,12 +36,7 @@ class LinkButton extends Interactable
public function __toString()
{
// add "button" to attribute @class
@$this->attributes["class"] .= " button";
// add tabindex of zero to make buttons accesible when tabbing
if (!isset($this->attributes['tabindex'])) {
$this->attributes['tabindex'] = '0';
}
$this->attributes['class'] .= ' button';
$attributes = [];
ksort($this->attributes);
......
......@@ -24,13 +24,6 @@
&:hover, &:active {
background: @base-color;
color: white;
outline: 0;
}
&:focus {
outline: dotted 1px #000;
}
&::-moz-focus-inner {
border: 0;
}
&.disabled, &[disabled] {
......
......@@ -26,13 +26,6 @@
&:active {
background: $base-color;
color: white;
outline: 0;
}
&:focus {
outline: dotted 1px #000;
}
&::-moz-focus-inner {
border: 0;
}
&.disabled,
......
......@@ -20,49 +20,49 @@ class LinkButtonTestCase extends \Codeception\Test\Unit
function testCreateWithLabel()
{
$this->assertEquals('<a class="button" href="?" tabindex="0">yes</a>',
$this->assertEquals('<a class="button" href="?">yes</a>',
'' . LinkButton::create('yes'));
}
function testCreateWithLabelAndUrl()
{
$this->assertEquals('<a class="button" href="http://example.net" tabindex="0">yes</a>',
$this->assertEquals('<a class="button" href="http://example.net">yes</a>',
'' . LinkButton::create('yes', 'http://example.net'));
}
function testCreateWithLabelAndArray()
{
$this->assertEquals('<a a="1" b="2" class="button" href="?" tabindex="0">yes</a>',
$this->assertEquals('<a a="1" b="2" class="button" href="?">yes</a>',
'' . LinkButton::create('yes', ['a' => 1, 'b' => 2]));
}
function testCreateWithLabelUrlAndArray()
{
$this->assertEquals('<a a="1" b="2" class="button" href="http://example.net" tabindex="0">yes</a>',
$this->assertEquals('<a a="1" b="2" class="button" href="http://example.net">yes</a>',
'' . LinkButton::create('yes', 'http://example.net', ['a' => 1, 'b' => 2]));
}
function testCreateAccept()
{
$this->assertEquals('<a class="accept button" href="?" name="accept" tabindex="0">Übernehmen</a>',
$this->assertEquals('<a class="accept button" href="?" name="accept">Übernehmen</a>',
'' . LinkButton::createAccept());
}
function testCreateCancel()
{
$this->assertEquals('<a class="cancel button" href="?" name="cancel" tabindex="0">Abbrechen</a>',
$this->assertEquals('<a class="cancel button" href="?" name="cancel">Abbrechen</a>',
'' . LinkButton::createCancel());
}
function testCreatePreOrder()
{
$this->assertEquals('<a class="pre-order button" href="?" name="pre-order" tabindex="0">ok</a>',
$this->assertEquals('<a class="pre-order button" href="?" name="pre-order">ok</a>',
'' . LinkButton::createPreOrder());
}
function testCreateWithInsaneArguments()
{
$this->assertEquals('<a class="button" href="http://example.net?m=&amp;m=" mad="&lt;S&gt;tu&quot;ff" tabindex="0">&gt;ok&lt;</a>',
$this->assertEquals('<a class="button" href="http://example.net?m=&amp;m=" mad="&lt;S&gt;tu&quot;ff">&gt;ok&lt;</a>',
'' . LinkButton::create('>ok<', 'http://example.net?m=&m=', ['mad' => '<S>tu"ff']));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment