hoangnm / react-native-week-view

Week View Component for react-native
MIT License
323 stars 96 forks source link

BUG: Horizontal scroll issue #243

Open TheTushar2696 opened 2 years ago

TheTushar2696 commented 2 years ago

Describe the bug On horizontal scroll, it becomes stuck sometimes and then resumes to scroll again, attaching a video of the same

https://user-images.githubusercontent.com/40525668/180362825-0c2e21ab-a77f-4839-9e7e-167f5ec7f863.mov

Expected behavior Should scroll smoothly

pdpino commented 2 years ago

This is a trade-off issue between loading less data (UI responding faster, but possible blank spaces) vs loading more data (UI slower, less blank spaces):

Idea: we could expose props windowSize, updateCellsBatchingPeriod, maxToRenderPerBatch, so the user can tune them better. What do you think?

TheTushar2696 commented 2 years ago

@pdpino Apologies for the late response, was not well.

Coming back to your point, Just thinking out loud, If we give a window size as you mentioned, will it work well with goToDate function, because I've observed a similar behaviour when the user is moving to a specific date.

pdpino commented 2 years ago

will it work well with goToDate

you are right, it won't work well. See this similar issue: #207 when navigating to a far date (or even to close dates)

We are trying to solve that separately from the flatlist optimizations. The process when swiping with the finger (moving one page by one) is slightly different than goToDate (navigating to an arbitrary date)

TheTushar2696 commented 2 years ago

@pdpino Got it, Sure then we can try to add widow size, Since you mentioned we already are discussing this already, are you planning to take this up?

pdpino commented 2 years ago

@TheTushar2696 I sent a PR exposing the props. You can try different values to get better results, but I cannot assure you there will be better results

Some other comments:

  1. I'm implementing other optimizations to be able to implement some other features. These optimizations could help
  2. I think a better solution would be to block the scrolling for the user while the component is loading. I want to add this, but I need to do (1) first
TheTushar2696 commented 2 years ago

Hi @pdpino, Got it, Also one more thing I noticed is when I am populating large number of events it is showing this in console, any idea about it?

Screenshot 2022-08-03 at 2 52 15 AM
pdpino commented 2 years ago

@TheTushar2696 I haven't seen that one with week-view

This mentions passing large objects to console log