blackbaud / skyux2

SKY UX 2 is the new version of Blackbaud’s user experience framework that implements Blackbaud design patterns. It extends the framework to abstract many complexities of modern web development and takes advantage of Angular 2 to increase the tooling, testing, and performance available.
https://developer.blackbaud.com/skyux
MIT License
32 stars 65 forks source link

Infinite Scroll Cannot be Re-Enabled After Reaching List End #2240

Closed Blackbaud-NickGlyder closed 5 years ago

Blackbaud-NickGlyder commented 5 years ago

Expected behavior

When using an infinite scroll component, if no more data is available, a consumer should flip the [enabled] binding from true to false. If a later action changes the state of the list the infinite scroll is concerned with, and then re-enables the infinite scroll, the component should allow for more scrollEnd callbacks.

Actual behavior

Once the [enabled] binding is set to false for the first time in the life cycle of the component, re-enabling leads to a broken state where a sky-wait appears and no further scrollEnd notifications are published.

Steps to reproduce

  1. Completely load a set of data using infinite scroll as the trigger.
  2. Set the enabled flag to false
  3. Set the enabled flag to true
  4. Attempt to trigger a scroll callback

Plunker (see example SKY UX 2 plunker template at: https://plnkr.co/edit/GeP22YbirEzceF3NVu39?p=preview)

This plunker does not appear to load... I have a local example if this is deemed important.

Here is a potential "fix" https://github.com/nick-glyder/skyux-lists/blob/master/src/app/public/modules/infinite-scroll/infinite-scroll.component.ts

The above probably needs to actually capture and manage the subscriptions to the dom adapter but as a PoC it does work.

Severity

Low?

Impact

We are unable to move forward with infinite scroll due to this behavior.