From 3c4f5998f2a6c8a73193f69f991709388e91cab7 Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Sun, 8 Feb 2026 05:37:41 -0500 Subject: [PATCH] Force avatar re-render after showing preview-author div. Browsers skip rendering images inside display:none containers. Re-assign the src attribute after making the div visible to force the browser to render the SVG data URI. --- remarkbox/static/js/custom.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/remarkbox/static/js/custom.js b/remarkbox/static/js/custom.js index 41089fe..300abb8 100644 --- a/remarkbox/static/js/custom.js +++ b/remarkbox/static/js/custom.js @@ -8,6 +8,13 @@ function updatePreviewAuthor(previewDiv) { var author = previewDiv.querySelector('.preview-author'); if (!author) return; author.style.display = ''; + // Force avatar re-render: browsers skip images in display:none containers. + var img = author.querySelector('img'); + if (img) { + var src = img.getAttribute('src'); + img.removeAttribute('src'); + img.setAttribute('src', src); + } var form = previewDiv.closest('form'); if (form) { var nameInput = form.querySelector('[name="anonymous_name"]');