raystack / apsara

Apsara is an open-source re-usable UI components built using Radix UI and CSS modules to power Raystack projects.
https://apsara-raystack.vercel.app/
57 stars 11 forks source link

Fix/infinite scroll #141

Closed paanSinghCoder closed 2 months ago

paanSinghCoder commented 2 months ago

Parent PR - PR-140

Why break down the logic into two useEffects?

First useEffect: Initialises the Intersection Observer (observerRef) when the onLoadMore function is passed in props. Threshold is set to 10% i.e. this will be triggered when 10% of the row has intersected.

Second useEffect: Attaches the observer to the last row of the table, triggered whenever isLoading changes.

Issues found: here the global loader is conflicting with the infinite scroll. Functionality working fine.

Testing: Manually tested with www/example and Frontier Admin UI

vercel[bot] commented 2 months ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
apsara ❌ Failed (Inspect) Sep 4, 2024 7:38am