From 02359d71d66fbb4f53f8237845b0d4b4a301a272 Mon Sep 17 00:00:00 2001 From: Eduard Kuzmenko Date: Mon, 24 Jan 2022 04:03:02 +0400 Subject: [PATCH] Fix emoji animation's position on changing chat --- src/components/wrappers.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/wrappers.ts b/src/components/wrappers.ts index 015bdfaa..4da45e30 100644 --- a/src/components/wrappers.ts +++ b/src/components/wrappers.ts @@ -1399,6 +1399,10 @@ export function wrapSticker({doc, div, middleware, lazyLoadQueue, group, play, o const randomOffsetY = generateRandomSigned(4); const stableOffsetX = size / 8 * (isOut ? 1 : -1); const setPosition = () => { + if(!isInDOM(div)) { + return; + } + const rect = div.getBoundingClientRect(); /* const boxWidth = Math.max(rect.width, rect.height); const boxHeight = Math.max(rect.width, rect.height);