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.
This commit is contained in:
Sayam Samal 2024-11-05 19:30:16 +05:30 committed by Tim Abbott
parent 7fc9fc32d1
commit 62b24c6d92
1 changed files with 1 additions and 1 deletions

View File

@ -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;