fix(dashboard): notification list scroll flickering (#11911)

* fix: flicekring of the notification list due to rerendering

* fix: revert page size

* fix: page size

* fix: reintroduce treshold

* fix: param

* fix: revert page size
This commit is contained in:
Frane Polić
2025-03-28 08:58:33 +01:00
committed by GitHub
parent 95230ef670
commit be6a651e2f

View File

@@ -74,17 +74,27 @@ export const InfiniteList = <
// Define the new observers after we stop fetching
if (!isFetching) {
// Define the new observers after paginating
startObserver.current = new IntersectionObserver((entries) => {
if (entries[0].isIntersecting && hasPreviousPage) {
fetchPreviousPage()
startObserver.current = new IntersectionObserver(
(entries) => {
if (entries[0].isIntersecting && hasPreviousPage) {
fetchPreviousPage()
}
},
{
threshold: 0.5,
}
})
)
endObserver.current = new IntersectionObserver((entries) => {
if (entries[0].isIntersecting && hasNextPage) {
fetchNextPage()
endObserver.current = new IntersectionObserver(
(entries) => {
if (entries[0].isIntersecting && hasNextPage) {
fetchNextPage()
}
},
{
threshold: 0.5,
}
})
)
// Register the new observers to observe the new first and last children
startObserver.current?.observe(parentRef.current!.firstChild as Element)