From ba19bcc729850c5591d989714ffa3af6d4685d4a Mon Sep 17 00:00:00 2001 From: Pavel Mineev Date: Tue, 29 Nov 2022 19:06:48 -0500 Subject: [PATCH] fix: update iframe size on mount --- frontend/apps/remark42/app/components/root/root.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/frontend/apps/remark42/app/components/root/root.tsx b/frontend/apps/remark42/app/components/root/root.tsx index 91f8e0c7..839dd1d6 100644 --- a/frontend/apps/remark42/app/components/root/root.tsx +++ b/frontend/apps/remark42/app/components/root/root.tsx @@ -305,10 +305,9 @@ function Comments({ isLoading, topComments, commentsShown, showMore }: CommentsP return; } + updateIframeHeight(); // TODO: throttle updates const observer = new MutationObserver(() => { - updateIframeHeight(); - // a hacky way to force iframe height update when new image is rendered and loaded rootRef.current?.querySelectorAll('img').forEach((img) => { img.addEventListener('load', updateIframeHeight);