compose: Check if compose control btn popover has the clicked element.

This is necessary to avoid a poptention bug where the popover
is open but the button is clicked somewhere else.
This commit is contained in:
Aman Agrawal
2021-12-04 09:05:05 +00:00
committed by Tim Abbott
parent d749438551
commit ec48f29daf

View File

@@ -404,7 +404,10 @@ export function show_compose_spinner() {
export function get_compose_click_target(e) {
const compose_control_buttons_popover = popover_menus.get_compose_control_buttons_popover();
if (compose_control_buttons_popover) {
if (
compose_control_buttons_popover &&
$(compose_control_buttons_popover.popper).has(e.target).length
) {
return compose_control_buttons_popover.reference;
}
return e.target;