Composer: shouldCollapse --> isClickOutside

This commit is contained in:
Alex Gleason 2020-05-26 15:26:07 -05:00
parent 808e05a03f
commit 55578a4381
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -97,8 +97,10 @@ class ComposeForm extends ImmutablePureComponent {
return clickableAreaRef ? clickableAreaRef.current : this.form;
}
shouldCollapse = (e) => {
isClickOutside = (e) => {
return ![
// List of elements that shouldn't collapse the composer when clicked
// FIXME: Make this less brittle
this.getClickableArea(),
document.querySelector('.privacy-dropdown__dropdown'),
document.querySelector('.emoji-picker-dropdown__menu'),
@ -107,7 +109,7 @@ class ComposeForm extends ImmutablePureComponent {
}
handleClick = (e) => {
if (this.shouldCollapse(e)) {
if (this.isClickOutside(e)) {
this.handleClickOutside();
}
}