From 62b24c6d92568e9d9583e313508f87145558edbb Mon Sep 17 00:00:00 2001 From: Sayam Samal Date: Tue, 5 Nov 2024 19:30:16 +0530 Subject: [PATCH] user_card_popover: Fix unknown user_id in unsaved message user mentions. Previously, the event handler was targeting the `event.target` element instead of the `event.currentTarget` element. Due to event bubbling, this lead to incorrect element being used to extract the `data-user-id`, resulting in an error whenever a user mention was clicked in the unsaved message in the message box or the drafts view. --- web/src/user_card_popover.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/user_card_popover.js b/web/src/user_card_popover.js index b00ecfb5be..d05bab4398 100644 --- a/web/src/user_card_popover.js +++ b/web/src/user_card_popover.js @@ -458,7 +458,7 @@ function toggle_user_card_popover_for_message( export function unsaved_message_user_mention_event_handler(e) { e.stopPropagation(); - const id_string = $(e.target).attr("data-user-id"); + const id_string = $(e.currentTarget).attr("data-user-id"); // Do not open popover for @all mention if (id_string === "*") { return;