Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Horizontal scroll issue #243

Open
TheTushar2696 opened this issue Jul 22, 2022 · 7 comments
Open

BUG: Horizontal scroll issue #243

TheTushar2696 opened this issue Jul 22, 2022 · 7 comments

Comments

@TheTushar2696
Copy link

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

Screen.Recording.2022-07-22.at.9.57.21.AM.mov

Expected behavior
Should scroll smoothly

@pdpino
Copy link
Collaborator

pdpino commented Jul 22, 2022

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):

  • When the view is near the end to the right the component loads and render more weeks to the right. This process takes time
  • If the user scrolls too often/fast, you see the behavior you're describing
  • We currently try to optimize this with some of these FlatList props. You can check the props pros and cons for the trade-off. For example we set windowSize=5 (5 weeks = 2 to the left + 1 central + 2 to the right)

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

@TheTushar2696
Copy link
Author

TheTushar2696 commented Jul 28, 2022

@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
Copy link
Collaborator

pdpino commented Jul 28, 2022

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
Copy link
Author

TheTushar2696 commented Jul 29, 2022

@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
Copy link
Collaborator

pdpino commented Jul 29, 2022

@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
Copy link
Author

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
Copy link
Collaborator

pdpino commented Aug 2, 2022

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

This mentions passing large objects to console log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants