Composer: shouldCollapse --> isClickOutside

stable/1.0.x
Alex Gleason 2020-05-26 15:26:07 -05:00
rodzic 808e05a03f
commit 55578a4381
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 4 dodań i 2 usunięć

Wyświetl plik

@ -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();
}
}