Fix inline compose form clickable area, fixes #30

stable/1.0.x
Alex Gleason 2020-04-20 16:53:22 -05:00
rodzic de703ab748
commit 0ec8e39051
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 7211D1F99744FBB7
1 zmienionych plików z 9 dodań i 3 usunięć

Wyświetl plik

@ -105,10 +105,16 @@ class ComposeForm extends ImmutablePureComponent {
return clickableAreaRef ? clickableAreaRef.current : this.form;
}
shouldCollapse = (e) => {
return ![
this.getClickableArea(),
document.querySelector('.privacy-dropdown__dropdown'),
document.querySelector('.emoji-picker-dropdown__menu'),
].some(element => element && element.contains(e.target));
}
handleClick = (e) => {
const clickableArea = this.getClickableArea();
if (!clickableArea) return;
if (!clickableArea.contains(e.target)) {
if (this.shouldCollapse(e)) {
this.handleClickOutside();
}
}