Revert "pass getClickableArea into autosuggesttextarea as prop"

This reverts commit 99f0a069dd.
This commit is contained in:
Alex Gleason 2020-09-28 19:05:56 -05:00
parent 18d08a3630
commit b78a00a306
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
2 changed files with 6 additions and 3 deletions

View file

@ -51,7 +51,6 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
onFocus: PropTypes.func, onFocus: PropTypes.func,
onBlur: PropTypes.func, onBlur: PropTypes.func,
clickableAreaRef: PropTypes.object, clickableAreaRef: PropTypes.object,
getClickableArea: PropTypes.func.isRequired,
}; };
static defaultProps = { static defaultProps = {
@ -165,9 +164,14 @@ export default class AutosuggestTextarea extends ImmutablePureComponent {
this.textarea.focus(); this.textarea.focus();
} }
getClickableArea = () => {
const { clickableAreaRef } = this.props;
return clickableAreaRef ? clickableAreaRef.current : this.form;
}
isClickInside = (e) => { isClickInside = (e) => {
return [ return [
this.props.getClickableArea(), this.getClickableArea(),
document.querySelector('.autosuggest-textarea__textarea'), document.querySelector('.autosuggest-textarea__textarea'),
].some(element => element && element.contains(e.target)); ].some(element => element && element.contains(e.target));
} }

View file

@ -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 &&