diff --git a/src/components/middle/message/Message.tsx b/src/components/middle/message/Message.tsx index dee449887..3e85dfbea 100644 --- a/src/components/middle/message/Message.tsx +++ b/src/components/middle/message/Message.tsx @@ -127,6 +127,7 @@ import useMessageTranslation from './hooks/useMessageTranslation'; import usePrevious from '../../../hooks/usePrevious'; import useTextLanguage from '../../../hooks/useTextLanguage'; import useAuthorWidth from '../hooks/useAuthorWidth'; +import { dispatchHeavyAnimationEvent } from '../../../hooks/useHeavyAnimationCheck'; import Button from '../../ui/Button'; import Avatar from '../../common/Avatar'; @@ -280,6 +281,7 @@ const QUICK_REACTION_SIZE = 1.75 * REM; const EXTRA_SPACE_FOR_REACTIONS = 2.25 * REM; const BOTTOM_FOCUS_SCROLL_THRESHOLD = 5; const THROTTLE_MS = 300; +const RESIZE_ANIMATION_DURATION = 400; const Message: FC = ({ message, @@ -688,6 +690,8 @@ const Message: FC = ({ const container = entry.target.closest('.MessageList'); if (!container) return; + dispatchHeavyAnimationEvent(RESIZE_ANIMATION_DURATION); + const resizeDiff = newHeight - lastHeight; const { offsetHeight, scrollHeight, scrollTop } = container; const currentScrollBottom = Math.round(scrollHeight - scrollTop - offsetHeight);