about summary refs log tree commit diff
path: root/app/assets
diff options
context:
space:
mode:
authormhe <mail@marcus-herrmann.com>2016-11-02 20:18:39 +0100
committermhe <mail@marcus-herrmann.com>2016-11-02 20:18:39 +0100
commit87aabeb7af3c07faf872f8ce174fb0e7c0664f7b (patch)
tree54dcd39e6bcc623087a438b19683428cb86ed649 /app/assets
parent77045d088608eec16548a0dfb693a6307881048d (diff)
a11y: Improve icon button component regarding semantics and screen reader usage
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/components/components/icon_button.jsx6
-rw-r--r--app/assets/stylesheets/components.scss3
2 files changed, 5 insertions, 4 deletions
diff --git a/app/assets/javascripts/components/components/icon_button.jsx b/app/assets/javascripts/components/components/icon_button.jsx
index 509192260..085c18541 100644
--- a/app/assets/javascripts/components/components/icon_button.jsx
+++ b/app/assets/javascripts/components/components/icon_button.jsx
@@ -35,9 +35,9 @@ const IconButton = React.createClass({
     };
 
     return (
-      <a href='#' title={this.props.title} className={`icon-button ${this.props.active ? 'active' : ''}`} onClick={this.handleClick} style={style}>
-        <i className={`fa fa-fw fa-${this.props.icon}`}></i>
-      </a>
+      <button aria-label={this.props.title} title={this.props.title} className={`icon-button ${this.props.active ? 'active' : ''}`} onClick={this.handleClick} style={style}>
+        <i className={`fa fa-fw fa-${this.props.icon}`} aria-hidden='true'></i>
+      </button>
     );
   }
 
diff --git a/app/assets/stylesheets/components.scss b/app/assets/stylesheets/components.scss
index b720848c5..704462dc1 100644
--- a/app/assets/stylesheets/components.scss
+++ b/app/assets/stylesheets/components.scss
@@ -42,7 +42,8 @@
 
 .icon-button {
   color: #616b86;
-  cursor: pointer;
+  border: none;
+  background: transparent;
 
   &:hover {
     color: #717b98;