Skip to content

release: v3.16.3 #1325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog - v3

## [v3.16.3] (Apr 3 2025)
### Fixes:
- Fixed an issue where the connection is still alive after `SendbirdProvider` have been unmounted.
- Fixed an undefined error of `emojiCategory`.

## [v3.16.2] (Mar 28 2025)
### Features:
- Added `tel` and `mailto` protocol support for the markup link
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sendbird/uikit-react",
"version": "3.16.2",
"version": "3.16.3",
"description": "Sendbird UIKit for React: A feature-rich and customizable chat UI kit with messaging, channel management, and user authentication.",
"keywords": [
"sendbird",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,17 @@ describe('useMessageListScroll', () => {
});

describe('scroll', () => {
it('should do nothing if scrollRef is null', async () => {
it('should call resolve() even if scrollRef is null', async () => {
const { result } = renderHook(() => useMessageListScroll('auto'));
const resolveMock = jest.fn();

await act(async () => {
result.current.scrollPubSub.publish('scroll', { resolve: resolveMock });
});

expect(resolveMock).not.toHaveBeenCalled();
await waitFor(() => {
expect(resolveMock).toHaveBeenCalled();
});
});

it('should use scrollTop if scroll method is not defined', async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,20 +72,23 @@ export function useMessageListScroll(behavior: 'smooth' | 'auto', deps: Dependen
unsubscribes.push(
scrollPubSub.subscribe('scroll', ({ top, animated, lazy, resolve }) => {
runCallback(() => {
if (!scrollRef.current) return;
if (!scrollRef.current || typeof top !== 'number') {
resolve?.();
return;
}
const { scrollTop, scrollHeight, clientHeight } = scrollRef.current;

if (scrollRef.current.scroll) {
scrollRef.current.scroll({ top, behavior: getScrollBehavior(behavior, animated) });
} else if (typeof top === 'number') {
} else {
scrollRef.current.scrollTop = top;
}

// Update data by manual update
scrollDistanceFromBottomRef.current = Math.max(0, scrollHeight - scrollTop - clientHeight);
setIsScrollBottomReached(scrollDistanceFromBottomRef.current === 0);

if (resolve) resolve();
resolve?.();
}, lazy);
}),
);
Expand Down