Merge branch 'composer-revert' into 'develop'
Composer revert See merge request soapbox-pub/soapbox-fe!276
This commit is contained in:
commit
53758f6132
2 changed files with 0 additions and 28 deletions
|
@ -50,8 +50,6 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
|
|||
autoFocus: PropTypes.bool,
|
||||
onFocus: PropTypes.func,
|
||||
onBlur: PropTypes.func,
|
||||
clickableAreaRef: PropTypes.object,
|
||||
getClickableArea: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
|
@ -109,8 +107,6 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
|
|||
if (suggestions.size > 0 && !suggestionsHidden) {
|
||||
e.preventDefault();
|
||||
this.setState({ selectedSuggestion: Math.min(selectedSuggestion + 1, suggestions.size - 1) });
|
||||
} else {
|
||||
this.setState({ lastToken: null });
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -118,8 +114,6 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
|
|||
if (suggestions.size > 0 && !suggestionsHidden) {
|
||||
e.preventDefault();
|
||||
this.setState({ selectedSuggestion: Math.max(selectedSuggestion - 1, 0) });
|
||||
} else {
|
||||
this.setState({ lastToken: null });
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -165,27 +159,6 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
|
|||
this.textarea.focus();
|
||||
}
|
||||
|
||||
isClickInside = (e) => {
|
||||
return [
|
||||
this.props.getClickableArea(),
|
||||
document.querySelector('.autosuggest-textarea__textarea'),
|
||||
].some(element => element && element.contains(e.target));
|
||||
}
|
||||
|
||||
handleClick = (e) => {
|
||||
if (this.isClickInside(e)) {
|
||||
this.setState({ lastToken: null });
|
||||
}
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
document.addEventListener('click', this.handleClick, true);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
document.removeEventListener('click', this.handleClick, true);
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps, prevState) {
|
||||
const { suggestions } = this.props;
|
||||
if (suggestions !== prevProps.suggestions && suggestions.size > 0 && prevState.suggestionsHidden && prevState.focused) {
|
||||
|
|
|
@ -286,7 +286,6 @@ class ComposeForm extends ImmutablePureComponent {
|
|||
onSuggestionSelected={this.onSuggestionSelected}
|
||||
onPaste={onPaste}
|
||||
autoFocus={shouldAutoFocus}
|
||||
getClickableArea={this.getClickableArea}
|
||||
>
|
||||
{
|
||||
!condensed &&
|
||||
|
|
Loading…
Reference in a new issue