PRD-2109: Chat list loading indicator extra space fix#18
Conversation
|
@veliseev93 please take a look |
| // NOTE: Reset scroll position when refresh completes to remove extra space left by refresh control | ||
| useEffect(() => { | ||
| if (previousIsRefetchingRef.current && !isRefetching && listRef.current) { | ||
| listRef.current.scrollToOffset({ offset: 0, animated: false }); |
There was a problem hiding this comment.
This solves the problem, but it seems that now, after a refresh, the chat list jumps up a little—it used to move more smoothly before. Could you please fix this issue?
Simulator.Screen.Recording.-.iPhone.17.-.2025-12-23.at.18.02.40.mov
There was a problem hiding this comment.
Fixed, i made scroll-resetting logic stricter
| }} | ||
| transformSectionTitle={transformSectionTitle} | ||
| onEndReached={fetchNextPage} | ||
| refreshControl={<AppRefreshControl onRefresh={refetch} refreshing={isRefetching} />} |
There was a problem hiding this comment.
@Tomass673 It seems that now I can reproduce the original bug with the spinning loader again.
There was a problem hiding this comment.
I fixed the original issue. When screen is unfocused and refetch starts - AppRefreshControl triggers iOS "[UIKitCore] A UIRefreshControl received offscreen beginRefreshing" warning. That's why content inset is still there after navigating back to chat list screen
There was a problem hiding this comment.
@Tomass673 Good idea, but could we just use useIsFocused hook here, since we use this condition in rendering?
import { useIsFocused } from '@react-navigation/native';
const isFocused = useIsFocused();
Task: https://app.clickup.com/t/24336023/PRD-2109