From 63d71ecb0ca16bbc62a04346531066ddeef66c8b Mon Sep 17 00:00:00 2001 From: Dinesh Date: Tue, 26 Apr 2022 11:14:33 +0530 Subject: [PATCH] popovers: Use e.currentTarget for .view_user_profile event listener. The previous version with e.target would give the element that was clicked lying inside an element with '.view_user_profile'. One would usually expect "data-user-id" to be attached to the same element with ".view_user_profile" instead of any of its children. So, to just look for "data-user-id" in the element with that class, instead of any of its chidren, this commit changes e.target to e.currentTarget. --- static/js/popovers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/popovers.js b/static/js/popovers.js index 827c6b026a..e9295c0e00 100644 --- a/static/js/popovers.js +++ b/static/js/popovers.js @@ -974,7 +974,7 @@ export function register_click_handlers() { }); $("body").on("click", ".view_user_profile", (e) => { - const user_id = Number.parseInt($(e.target).attr("data-user-id"), 10); + const user_id = Number.parseInt($(e.currentTarget).attr("data-user-id"), 10); const user = people.get_by_user_id(user_id); show_user_info_popover(e.target, user); e.stopPropagation();