naver / egjs-infinitegrid

A module used to arrange card elements including content infinitely on a grid layout.
https://naver.github.io/egjs-infinitegrid/
MIT License
2.2k stars 94 forks source link

MasonryInfiniteGrid onRequestAppend endlessly called #495

Open feiyl opened 2 years ago

feiyl commented 2 years ago

Description

Excuse me, I use MasonryInfiniteGrid for building my infinte card view app.I don't know why the onRequestAppend function is constantly called, endlessly called unless I set threshold to 0. Do me a favor to explain why is it, maybe is there any monitor triggered?

Steps to check or reproduce

daybrush commented 2 years ago

@feiyl

Perhaps it is correct that requestAppend is called every time you scroll when the threshold is reached.

If not this case, is there such a case?

The case of blocking requestAppend is as follows.

  1. Adding data https://naver.github.io/egjs-infinitegrid/Guides#use-wait--ready
  2. Last data
    onRequestAppend={() => {
    if (this.lastItems) {
       return;
    }
    }}