Skip to content

Commit b38d10c

Browse files
authored
[fix] Adjust scroll on quote message rendering (#1334)
Fixes [CLNP-6705](https://sendbird.atlassian.net/browse/CLNP-6705) ### Changelogs - Fixed that the scroll not going to bottom on quoted message rendering ### Checklist Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If unsure, ask the members. This is a reminder of what we look for before merging your code. - [x] **All tests pass locally with my changes** - [ ] **I have added tests that prove my fix is effective or that my feature works** - [ ] **Public components / utils / props are appropriately exported** - [ ] I have added necessary documentation (if appropriate) [CLNP-6705]: https://sendbird.atlassian.net/browse/CLNP-6705?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent 1666c08 commit b38d10c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/ui/MessageContent/index.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { ReactElement, ReactNode, useRef, useState } from 'react';
1+
import React, { ReactElement, ReactNode, useEffect, useRef, useState } from 'react';
22
import format from 'date-fns/format';
33
import './index.scss';
44

@@ -175,6 +175,12 @@ export function MessageContent(props: MessageContentProps): ReactElement {
175175
);
176176
const useReplyingClassName = useReplying ? 'use-quote' : '';
177177

178+
useEffect(() => {
179+
if (useReplying) {
180+
onMessageHeightChange?.();
181+
}
182+
}, [useReplying]);
183+
178184
// Thread replies
179185
const displayThreadReplies = message?.threadInfo?.replyCount
180186
&& message.threadInfo.replyCount > 0

0 commit comments

Comments
 (0)