aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElmar Ludwig <elmar.ludwig@uni-osnabrueck.de>2022-07-12 19:34:00 +0000
committerDavid Siegfried <david.siegfried@uni-vechta.de>2022-07-12 19:34:00 +0000
commitcea74f152c0211c157413a952af7c41c869e617e (patch)
tree9b8d91094f2e39f1a4754b06bcf92702e70e44f7
parentb6f711b6717a10a81f98a29f89ad0a60dda98528 (diff)
stop overriding the button focus outline, fixes #1304
Closes #1304 Merge request studip/studip!800
-rw-r--r--lib/classes/LinkButton.class.php7
-rw-r--r--resources/assets/stylesheets/less/buttons.less7
-rw-r--r--resources/assets/stylesheets/scss/buttons.scss7
-rw-r--r--tests/unit/lib/classes/LinkButtonTest.php16
4 files changed, 9 insertions, 28 deletions
diff --git a/lib/classes/LinkButton.class.php b/lib/classes/LinkButton.class.php
index 2667862..6d60da8 100644
--- a/lib/classes/LinkButton.class.php
+++ b/lib/classes/LinkButton.class.php
@@ -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);
diff --git a/resources/assets/stylesheets/less/buttons.less b/resources/assets/stylesheets/less/buttons.less
index d2b840f..d11ac0d 100644
--- a/resources/assets/stylesheets/less/buttons.less
+++ b/resources/assets/stylesheets/less/buttons.less
@@ -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] {
diff --git a/resources/assets/stylesheets/scss/buttons.scss b/resources/assets/stylesheets/scss/buttons.scss
index 5d86edd..3ffb84c 100644
--- a/resources/assets/stylesheets/scss/buttons.scss
+++ b/resources/assets/stylesheets/scss/buttons.scss
@@ -26,13 +26,6 @@
&:active {
background: $base-color;
color: white;
- outline: 0;
- }
- &:focus {
- outline: dotted 1px #000;
- }
- &::-moz-focus-inner {
- border: 0;
}
&.disabled,
diff --git a/tests/unit/lib/classes/LinkButtonTest.php b/tests/unit/lib/classes/LinkButtonTest.php
index a0b8f11..c83669b 100644
--- a/tests/unit/lib/classes/LinkButtonTest.php
+++ b/tests/unit/lib/classes/LinkButtonTest.php
@@ -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']));
}
}