0
0
Fork 0

Improve accessibility (part 7) (#4457)

* fix(media_modal): Keyboard navigation

* fix(column_back_button): Use native button

* fix(media_gallery): Keyboard navigation

* fix(status_content): Make CW content focusable
This commit is contained in:
Sorin Davidoi 2017-07-31 00:18:15 +02:00 committed by Eugen Rochko
parent 970297a138
commit e44f03bc71
37 changed files with 90 additions and 18 deletions

View file

@ -8,19 +8,20 @@ export default class ColumnBackButton extends React.PureComponent {
router: PropTypes.object,
};
handleClick = (e) => {
if (!e.key || e.key === 'Enter') {
if (window.history && window.history.length === 1) this.context.router.history.push('/');
else this.context.router.history.goBack();
handleClick = () => {
if (window.history && window.history.length === 1) {
this.context.router.history.push('/');
} else {
this.context.router.history.goBack();
}
}
render () {
return (
<div role='button' tabIndex='0' onClick={this.handleClick} onKeyDown={this.handleClick} className='column-back-button'>
<button onClick={this.handleClick} className='column-back-button'>
<i className='fa fa-fw fa-chevron-left column-back-button__icon' />
<FormattedMessage id='column_back_button.label' defaultMessage='Back' />
</div>
</button>
);
}