about summary refs log tree commit diff
path: root/app/javascript/flavours/glitch/components/column_header.js
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2018-03-16 17:19:38 +0100
committerThibaut Girka <thib@sitedethib.com>2018-04-22 19:17:10 +0200
commitabf7c5b85016ec1c660ef8c6598f4b8acbb8c41c (patch)
tree0cfcab054e4883537d63a5dd823a0d2508181ac1 /app/javascript/flavours/glitch/components/column_header.js
parent06fc278e4cfad385ba1ffd672c8c43a800f49bc3 (diff)
[Glitch] Fix column headers accessibility
Port 08e4c78e78358c2847967e9cc34b4a6497be97e2 to glitch-soc.

SCSS fix inspired by 69f13e7bca90f4855e05a49dd69bba66f843134a.
Diffstat (limited to 'app/javascript/flavours/glitch/components/column_header.js')
-rw-r--r--app/javascript/flavours/glitch/components/column_header.js19
1 files changed, 8 insertions, 11 deletions
diff --git a/app/javascript/flavours/glitch/components/column_header.js b/app/javascript/flavours/glitch/components/column_header.js
index ae90b6f81..e4296ecef 100644
--- a/app/javascript/flavours/glitch/components/column_header.js
+++ b/app/javascript/flavours/glitch/components/column_header.js
@@ -28,7 +28,6 @@ export default class ColumnHeader extends React.PureComponent {
     active: PropTypes.bool,
     localSettings : ImmutablePropTypes.map,
     multiColumn: PropTypes.bool,
-    focusable: PropTypes.bool,
     showBackButton: PropTypes.bool,
     notifCleaning: PropTypes.bool, // true only for the notification column
     notifCleaningActive: PropTypes.bool,
@@ -41,10 +40,6 @@ export default class ColumnHeader extends React.PureComponent {
     intl: PropTypes.object.isRequired,
   };
 
-  static defaultProps = {
-    focusable: true,
-  }
-
   state = {
     collapsed: true,
     animating: false,
@@ -91,7 +86,7 @@ export default class ColumnHeader extends React.PureComponent {
   }
 
   render () {
-    const { intl, icon, active, children, pinned, onPin, multiColumn, focusable, showBackButton, intl: { formatMessage }, notifCleaning, notifCleaningActive } = this.props;
+    const { intl, icon, active, children, pinned, onPin, multiColumn, showBackButton, intl: { formatMessage }, notifCleaning, notifCleaningActive } = this.props;
     const { collapsed, animating, animatingNCD } = this.state;
 
     let title = this.props.title;
@@ -172,11 +167,13 @@ export default class ColumnHeader extends React.PureComponent {
 
     return (
       <div className={wrapperClassName}>
-        <h1 tabIndex={focusable ? 0 : null} role='button' className={buttonClassName} aria-label={title} onClick={this.handleTitleClick}>
-          <i className={`fa fa-fw fa-${icon} column-header__icon`} />
-          <span className='column-header__title'>
-            {title}
-          </span>
+        <h1 className={buttonClassName}>
+          <button onClick={this.handleTitleClick}>
+            <i className={`fa fa-fw fa-${icon} column-header__icon`} />
+            <span className='column-header__title'>
+              {title}
+            </span>
+          </button>
           <div className='column-header__buttons'>
             {backButton}
             { notifCleaning ? (