mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-09-01 09:45:10 +00:00
Inf-scroll: Change region to 'main' to ignore long tag/following list.
## Issue: 2789 `Infinite scrolling should activate at end of listed claims, not subscription list`
This commit is contained in:
parent
dad10f1118
commit
16ea14887c
1 changed files with 4 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
// @flow
|
// @flow
|
||||||
import { MAIN_WRAPPER_CLASS } from 'component/app/view';
|
import { MAIN_CLASS } from 'component/page/view';
|
||||||
import type { Node } from 'react';
|
import type { Node } from 'react';
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect } from 'react';
|
||||||
import classnames from 'classnames';
|
import classnames from 'classnames';
|
||||||
|
@ -71,10 +71,10 @@ export default function ClaimList(props: Props) {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleScroll = debounce(e => {
|
const handleScroll = debounce(e => {
|
||||||
if (page && pageSize && onScrollBottom) {
|
if (page && pageSize && onScrollBottom) {
|
||||||
const mainElWrapper = document.querySelector(`.${MAIN_WRAPPER_CLASS}`);
|
const mainEl = document.querySelector(`.${MAIN_CLASS}`);
|
||||||
|
|
||||||
if (mainElWrapper && !loading && urisLength >= pageSize) {
|
if (mainEl && !loading && urisLength >= pageSize) {
|
||||||
const contentWrapperAtBottomOfPage = mainElWrapper.getBoundingClientRect().bottom - 0.5 <= window.innerHeight;
|
const contentWrapperAtBottomOfPage = mainEl.getBoundingClientRect().bottom - 0.5 <= window.innerHeight;
|
||||||
|
|
||||||
if (contentWrapperAtBottomOfPage) {
|
if (contentWrapperAtBottomOfPage) {
|
||||||
onScrollBottom();
|
onScrollBottom();
|
||||||
|
|
Loading…
Add table
Reference in a new issue