diff --git a/web/src/messages_overlay_ui.ts b/web/src/messages_overlay_ui.ts index 72e545417c..2a624e1d8a 100644 --- a/web/src/messages_overlay_ui.ts +++ b/web/src/messages_overlay_ui.ts @@ -181,5 +181,7 @@ function scroll_to_element($element: JQuery, context: Context): void { } function get_element_by_id(id: number | string, context: Context): JQuery { - return $(`[${CSS.escape(context.id_attribute_name)}='${CSS.escape(id.toString())}']`); + return $( + `.overlay-message-row[${CSS.escape(context.id_attribute_name)}='${CSS.escape(id.toString())}']`, + ); }