diff --git a/phpBB/assets/javascript/mentions.js b/phpBB/assets/javascript/mentions.js
index 94ac595cf7..0c34b07b69 100644
--- a/phpBB/assets/javascript/mentions.js
+++ b/phpBB/assets/javascript/mentions.js
@@ -56,8 +56,7 @@
return defaultAvatar(type);
}
- const $avatarSpan = $mentionAvatarTemplate.clone();
- $avatarSpan.removeAttr('style'); // Remove automatically added display: none
+ const $avatarSpan = $($mentionAvatarTemplate.html());
if (data.html === '') {
const $avatarImg = $avatarSpan.find('img');
diff --git a/phpBB/styles/prosilver/template/mentions_templates.html b/phpBB/styles/prosilver/template/mentions_templates.html
index bd1820ea0e..bf1b2188fd 100644
--- a/phpBB/styles/prosilver/template/mentions_templates.html
+++ b/phpBB/styles/prosilver/template/mentions_templates.html
@@ -1 +1 @@
-
+