diff --git a/.eslintrc.yml b/.eslintrc.yml
index aa23bebbfc5..12bdf342a8b 100644
--- a/.eslintrc.yml
+++ b/.eslintrc.yml
@@ -49,6 +49,7 @@ rules:
no-trailing-spaces: warn
react/jsx-wrap-multilines: error
+ react/jsx-no-bind: error
react/self-closing-comp: error
react/prop-types: error
react/no-multi-comp: off
diff --git a/app/javascript/mastodon/components/autosuggest_textarea.js b/app/javascript/mastodon/components/autosuggest_textarea.js
index b3d62ec3a65..24fa2b92057 100644
--- a/app/javascript/mastodon/components/autosuggest_textarea.js
+++ b/app/javascript/mastodon/components/autosuggest_textarea.js
@@ -145,7 +145,8 @@ class AutosuggestTextarea extends ImmutablePureComponent {
}, 100);
}
- onSuggestionClick (suggestion, e) {
+ onSuggestionClick (e) {
+ const suggestion = Number(e.currentTarget.getAttribute('data-index'));
e.preventDefault();
this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestion);
this.textarea.focus();
@@ -204,8 +205,9 @@ class AutosuggestTextarea extends ImmutablePureComponent {
role='button'
tabIndex='0'
key={suggestion}
+ data-index={suggestion}
className={`autosuggest-textarea__suggestions__item ${i === selectedSuggestion ? 'selected' : ''}`}
- onClick={this.onSuggestionClick.bind(this, suggestion)}>
+ onClick={this.onSuggestionClick}>