Fix eslint6 jsx-a11y/no-static-element-interactions

[MAILPOET-1140]
This commit is contained in:
Pavel Dohnal
2018-03-15 11:19:48 +00:00
parent b5a322a8e1
commit 756367dd50
5 changed files with 26 additions and 4 deletions

View File

@@ -31,7 +31,6 @@
"react/jsx-boolean-value": 0,
"react/jsx-no-bind": 0,
"react/no-array-index-key": 0,
"jsx-a11y/no-static-element-interactions": 0,
"jsx-a11y/alt-text": 0,
"func-names": 0,
"object-shorthand": 0,

View File

@@ -74,7 +74,11 @@ const ListingColumn = React.createClass({
if (this.props.column.sortable === true) {
label = (
<a onClick={this.handleSort}>
<a
onClick={this.handleSort}
role="button"
tabIndex={0}
>
<span>{ this.props.column.label }</span>
<span className="sorting-indicator" />
</a>
@@ -84,6 +88,7 @@ const ListingColumn = React.createClass({
}
return (
<th
role="columnheader"
className={classes}
id={this.props.column.name}
scope="col"

View File

@@ -90,6 +90,8 @@ const ListingItem = React.createClass({
<span
onClick={this.props.onRefreshItems}
key={`action-${index}`} className={action.name}
role="button"
tabIndex={index}
>
{(!isFirst) ? ' | ' : ''}
{ action.link(this.props.item) }

View File

@@ -127,12 +127,16 @@ class TemplateBox extends React.Component {
<a
className="button button-secondary"
onClick={this.onPreview}
role="button"
tabIndex={0}
>{MailPoet.I18n.t('preview')}</a>
&nbsp;
<a
className="button button-primary"
data-automation-id={`select_template_${index}`}
onClick={this.onSelect}
role="button"
tabIndex={0}
> {MailPoet.I18n.t('select')} </a>
</div>
{ readonly === '1' ? false : deleteLink }

View File

@@ -81,7 +81,13 @@ define(
description: MailPoet.I18n.t('regularNewsletterTypeDescription'),
action: function () {
return (
<a className="button button-primary" data-automation-id="create_standard" onClick={this.createNewsletter.bind(null, 'standard')}>
<a
className="button button-primary"
data-automation-id="create_standard"
onClick={this.createNewsletter.bind(null, 'standard')}
role="button"
tabIndex={0}
>
{MailPoet.I18n.t('create')}
</a>
);
@@ -107,7 +113,13 @@ define(
description: MailPoet.I18n.t('postNotificationNewsletterTypeDescription'),
action: function () {
return (
<a className="button button-primary" data-automation-id="create_notification" onClick={this.setupNewsletter.bind(null, 'notification')}>
<a
className="button button-primary"
data-automation-id="create_notification"
onClick={this.setupNewsletter.bind(null, 'notification')}
role="button"
tabIndex={0}
>
{MailPoet.I18n.t('setUp')}
</a>
);