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,
|
autoFocus: PropTypes.bool,
|
||||||
onFocus: PropTypes.func,
|
onFocus: PropTypes.func,
|
||||||
onBlur: PropTypes.func,
|
onBlur: PropTypes.func,
|
||||||
clickableAreaRef: PropTypes.object,
|
|
||||||
getClickableArea: PropTypes.func.isRequired,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
|
@ -109,8 +107,6 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
|
||||||
if (suggestions.size > 0 && !suggestionsHidden) {
|
if (suggestions.size > 0 && !suggestionsHidden) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.setState({ selectedSuggestion: Math.min(selectedSuggestion + 1, suggestions.size - 1) });
|
this.setState({ selectedSuggestion: Math.min(selectedSuggestion + 1, suggestions.size - 1) });
|
||||||
} else {
|
|
||||||
this.setState({ lastToken: null });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -118,8 +114,6 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
|
||||||
if (suggestions.size > 0 && !suggestionsHidden) {
|
if (suggestions.size > 0 && !suggestionsHidden) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
this.setState({ selectedSuggestion: Math.max(selectedSuggestion - 1, 0) });
|
this.setState({ selectedSuggestion: Math.max(selectedSuggestion - 1, 0) });
|
||||||
} else {
|
|
||||||
this.setState({ lastToken: null });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -165,27 +159,6 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
|
||||||
this.textarea.focus();
|
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) {
|
componentDidUpdate(prevProps, prevState) {
|
||||||
const { suggestions } = this.props;
|
const { suggestions } = this.props;
|
||||||
if (suggestions !== prevProps.suggestions && suggestions.size > 0 && prevState.suggestionsHidden && prevState.focused) {
|
if (suggestions !== prevProps.suggestions && suggestions.size > 0 && prevState.suggestionsHidden && prevState.focused) {
|
||||||
|
|
|
@ -286,7 +286,6 @@ class ComposeForm extends ImmutablePureComponent {
|
||||||
onSuggestionSelected={this.onSuggestionSelected}
|
onSuggestionSelected={this.onSuggestionSelected}
|
||||||
onPaste={onPaste}
|
onPaste={onPaste}
|
||||||
autoFocus={shouldAutoFocus}
|
autoFocus={shouldAutoFocus}
|
||||||
getClickableArea={this.getClickableArea}
|
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
!condensed &&
|
!condensed &&
|
||||||
|
|
Loading…
Reference in a new issue