fix(useInfiniteScroll): improve promise handling and add flush post to watch#5122
Conversation
@vueuse/components
@vueuse/core
@vueuse/electron
@vueuse/firebase
@vueuse/integrations
@vueuse/math
@vueuse/metadata
@vueuse/nuxt
@vueuse/router
@vueuse/rxjs
@vueuse/shared
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5122 +/- ##
=======================================
Coverage 64.35% 64.35%
=======================================
Files 343 343
Lines 6641 6641
Branches 2030 2030
=======================================
Hits 4274 4274
Misses 1965 1965
Partials 402 402 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
3d6c06f to
04fcda3
Compare
|
Thank you 🙏🏽 Would you mind adding some tests to cover the new handling? |
af98d59 to
de3d12d
Compare
Hi @OrbisK, sorry for the late reply. I’ve tried adding tests for this change, but I still haven’t been able to write one that reproduces the issue. So I created a small live demo to show the behavior before and after this change. Without Hope this demo helps clarify the issue!! |
|
@maximepvrt, thanks for the reminder :) I've added a demo above. Let me know if you need anything else!! |
|
Hi @nhquyss, thanks for the update! I’ve just tested with the newly released v14.1.0 (which includes #5110) as well as with the PR build from pkg.pr.new. I’m running into an issue: it triggers infinite loading of my data. Here is a reproduction of the issue: Do you have any idea what might be causing this? |
de3d12d to
a5c1e16
Compare
I think the scroll container in your This causes Without a defined height, I've created a demo based on your reproduction with a Or if you prefer full-page scrolling, you can use Hope this helps resolve your issue!! |
|
@nhquyss A huge thank you for your help! 🙏 Thanks again! |
a5c1e16 to
b6dfbce
Compare
b6dfbce to
4f9eeec
Compare
…o watch - Move promise check to early return to prevent unnecessary logic execution - Add flush: 'post' to watch to ensure it runs after DOM updates
4f9eeec to
862da5a
Compare
43081j
left a comment
There was a problem hiding this comment.
Looks good to me 👍
Some tests would be very nice. If you can't figure them out, maybe one of the team can. Or when I'm back next week, I can.
Before submitting the PR, please make sure you do the following
fixes #123).Description
Follow-up improvements to #5110
For detailed, see this comment in PR
Changes
Move
promisecheck to early return to prevent unnecessary logic executionAdd
flush: 'post'to watch to ensure it runs after DOM updatesAdditional context