Infinite Scroll: Attempt to fix a weird bug with missing chats
This commit is contained in:
parent
0bc2d2b021
commit
a49b02e291
@ -140,7 +140,7 @@ const InfiniteScroll: FC<OwnProps> = ({
|
|||||||
const nextAnchor = listItemElements[0];
|
const nextAnchor = listItemElements[0];
|
||||||
if (nextAnchor) {
|
if (nextAnchor) {
|
||||||
const nextAnchorTop = nextAnchor.getBoundingClientRect().top;
|
const nextAnchorTop = nextAnchor.getBoundingClientRect().top;
|
||||||
const newAnchorTop = currentAnchor && currentAnchor !== nextAnchor
|
const newAnchorTop = currentAnchor && currentAnchor.offsetParent && currentAnchor !== nextAnchor
|
||||||
? currentAnchor.getBoundingClientRect().top
|
? currentAnchor.getBoundingClientRect().top
|
||||||
: nextAnchorTop;
|
: nextAnchorTop;
|
||||||
const isMovingUp = (
|
const isMovingUp = (
|
||||||
@ -161,7 +161,7 @@ const InfiniteScroll: FC<OwnProps> = ({
|
|||||||
const nextAnchor = listItemElements[listLength - 1];
|
const nextAnchor = listItemElements[listLength - 1];
|
||||||
if (nextAnchor) {
|
if (nextAnchor) {
|
||||||
const nextAnchorTop = nextAnchor.getBoundingClientRect().top;
|
const nextAnchorTop = nextAnchor.getBoundingClientRect().top;
|
||||||
const newAnchorTop = currentAnchor && currentAnchor !== nextAnchor
|
const newAnchorTop = currentAnchor && currentAnchor.offsetParent && currentAnchor !== nextAnchor
|
||||||
? currentAnchor.getBoundingClientRect().top
|
? currentAnchor.getBoundingClientRect().top
|
||||||
: nextAnchorTop;
|
: nextAnchorTop;
|
||||||
const isMovingDown = (
|
const isMovingDown = (
|
||||||
@ -179,7 +179,7 @@ const InfiniteScroll: FC<OwnProps> = ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!isUpdated) {
|
if (!isUpdated) {
|
||||||
if (currentAnchor) {
|
if (currentAnchor && currentAnchor.offsetParent) {
|
||||||
stateRef.current.currentAnchorTop = currentAnchor.getBoundingClientRect().top;
|
stateRef.current.currentAnchorTop = currentAnchor.getBoundingClientRect().top;
|
||||||
} else {
|
} else {
|
||||||
const nextAnchor = listItemElements[0];
|
const nextAnchor = listItemElements[0];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user