Skip to content
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

scroll fetching fix for chrome #381

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion frontend/src/components/Albums/Albums.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default function Albums() {

//fetch next albums when you reach the bottom of the current list
const onScroll = (e: any) => {
const bottom = e.target.scrollHeight - e.target.scrollTop === e.target.clientHeight;
const bottom = Math.abs(e.target.scrollHeight - e.target.scrollTop - e.target.clientHeight) < 2;
if (bottom && albums && albums.offset < albums.total) {
const limit = albums.limit;
const offset = albums.offset + limit;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/Playlists/Playlists.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export default function Playlists() {

//fetch next playlists when you reach the bottom of the current list
const onScroll = (e: any) => {
const bottom = e.target.scrollHeight - e.target.scrollTop === e.target.clientHeight;
const bottom = Math.abs(e.target.scrollHeight - e.target.scrollTop - e.target.clientHeight) < 2;
if (bottom && playlists && playlists.offset < playlists.total) {
const limit = playlists.limit;
const offset = playlists.offset + limit;
Expand Down