ngx-infinite-scroll icon indicating copy to clipboard operation
ngx-infinite-scroll copied to clipboard

ScrollUp jump to 0 again, after loading data

Open zeinali0 opened this issue 5 years ago • 15 comments

Hi

onScrollUp event when it trigger if the position of scroll be 0 befror loading data then it jump to position 0 again immediately after data loaded to the container

zeinali0 avatar Jul 30 '19 10:07 zeinali0

Yes I have the same issue

hexadeciman avatar Nov 13 '19 21:11 hexadeciman

same issue

MrMeowCat avatar Nov 21 '19 08:11 MrMeowCat

I was using whatsapp web client, and I noticed that they have the same issue, I guess there might be a hack to fix it but it's most likely an issue on the browser level.

hexadeciman avatar Nov 22 '19 10:11 hexadeciman

Yes I have the same issue. and this issue only in Prod build. on dev build is ok

"@angular/core": "^10.0.5", "ngx-infinite-scroll": "^9.0.0",

anishchenko-anton avatar Aug 01 '20 17:08 anishchenko-anton

Facing the same issue. If the binded array is updated using unshift the scroll set itself to the top position and does not remain in the previous position

sudiptokush avatar Sep 13 '20 21:09 sudiptokush

is this issue solved

Gayathri1522 avatar Oct 29 '20 13:10 Gayathri1522

@orizens any update on this? At least, please just let us know if you are planning to resolve this and how long it may take.

NRathodMoreyeahs avatar Dec 01 '20 20:12 NRathodMoreyeahs

@zeinali0 please share a reproduction by cloning the demo

orizens avatar Dec 02 '20 19:12 orizens

also @zeinali0 a possible workaround is to not render the container with ngx-is if there's no data.

orizens avatar Dec 02 '20 19:12 orizens

To reproduce the issue, i start from the exemple I add the code below into the constructor.

    of(null).pipe(
      delay(1000)
    ).subscribe(() => {
      this.prependItems(0, this.sum);
    });

Before delay prepend items, if we scroll even a little, datas will be added and we keep position we are. If we didn't scroll, datas added and keep positioning at the top of the list. So, we lose previous position we are before adding datas.

MarcoLaws avatar Apr 22 '21 12:04 MarcoLaws

Any update on this?

elmartino avatar Jun 06 '22 09:06 elmartino

+1

Tarek-Adra avatar Oct 07 '22 21:10 Tarek-Adra

+1

alejandrB000 avatar Feb 23 '23 23:02 alejandrB000

same, i'm using (scrolled) and (scrolledUp) to force show only MAX 30 items inside a div out of a bunch items

  • when (scrolled) is triggered => i push more 15 items then splice() to remove first 15 items
  • when (scrolledUp) is triggered => i unshift more 15 items then splice() to remove last 15 items

it work perfect on Android mobile but it will keep scrollTop=0 after (scrolledUp) on iPhone

NguyenVanCong1902 avatar Apr 19 '23 07:04 NguyenVanCong1902

Any update ?

Nicolasp-dev avatar Feb 12 '24 23:02 Nicolasp-dev