1
0
mirror of https://github.com/funamitech/mastodon synced 2024-12-12 13:48:35 +09:00

Revert "autoscroll emoji suggestions box"

This reverts commit c89cce0219.
This commit is contained in:
Ondřej Hruška 2017-09-28 08:56:32 +02:00
parent 8a24ad5828
commit 06e299cef5
No known key found for this signature in database
GPG Key ID: 2C5FD5035250423D

View File

@ -151,15 +151,6 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
} }
} }
componentDidUpdate () {
if (this.refs.selected) {
if (this.refs.selected.scrollIntoViewIfNeeded)
this.refs.selected.scrollIntoViewIfNeeded();
else
this.refs.selected.scrollIntoView({ behavior: 'auto', block: 'nearest' });
}
}
render () { render () {
const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus } = this.props; const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus } = this.props;
const { suggestionsHidden, selectedSuggestion } = this.state; const { suggestionsHidden, selectedSuggestion } = this.state;
@ -192,7 +183,6 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
<div className={`autosuggest-textarea__suggestions ${suggestionsHidden || suggestions.isEmpty() ? '' : 'autosuggest-textarea__suggestions--visible'}`}> <div className={`autosuggest-textarea__suggestions ${suggestionsHidden || suggestions.isEmpty() ? '' : 'autosuggest-textarea__suggestions--visible'}`}>
{suggestions.map((suggestion, i) => ( {suggestions.map((suggestion, i) => (
<div <div
ref={i === selectedSuggestion ? 'selected' : null}
role='button' role='button'
tabIndex='0' tabIndex='0'
key={suggestion} key={suggestion}