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

Delay when using WeekCalendar and AgendaList together. #2194

Open
aleberguer opened this issue Mar 21, 2023 · 6 comments
Open

Delay when using WeekCalendar and AgendaList together. #2194

aleberguer opened this issue Mar 21, 2023 · 6 comments
Labels

Comments

@aleberguer
Copy link

Description

Hello! I’m using the CalendarProvider to show a page with a WeekCalendar and an AgendaList working together. Everything looks good except for a delay when tapping on a day in the WeekCalendar. I’m attaching a video with this issue.

I was digging into the code, and I found that there is a debounce of 1 second in the scrollToSection function that is causing this delay. I tried to remove the debounce, and the delay is gone.

I'm not sure why this debounce is there, but maybe we can add a prop to decide whether to use the debounce or not?

Expected Behavior

When tapping a day in the WeekCalendar, the AgendaList scrolls immediately, and there is no noticeable delay between the tap in WeekCalendar and the scrolling.

Observed Behavior

When tapping a day in the WeekCalendar, there is a delay in scrolling the AgendaList to the day selected.

Environment

[email protected]
[email protected]

This is happening on both iOS/Android emulators and physical devices.

Reproducible Demo

 <CalendarProvider date="2022-01-07">
        <WeekCalendar hideDayNames firstDay={1} />
        <AgendaList
          sections={ITEMS}
          renderItem={CardItem}
          horizontal
          pagingEnabled
        />
</CalendarProvider>

Video

Screen.Recording.2023-03-21.at.13.59.15.mov
@brianjuhl
Copy link

Also experiencing this but when I remove the debounce the delay seems to persist for some reason. Have used patch package, removed node_modules, cleared expo cache, etc etc.

@aleberguer
Copy link
Author

I removed the debounce and it works smoothly. @brianjuhl Have you tried changing directly in the node_modules package?

@aleberguer
Copy link
Author

@Inbal-Tish, what are your thoughts on this issue?
I can work on making a PR, but I would like to know the best approach here. I don't know what the debounce is expected to solve, but it is making the calendar very laggy and not the best user experience.

Can we add a prop to the AgendaList to decide whether to use the debounce?
Or maybe a prop to give the debounce time, 1000 seems pretty arbitrary here.

@Inbal-Tish
Copy link
Collaborator

@aleberguer Hi. PR will be best. I would add a prop to control the debounce time.

@stale
Copy link

stale bot commented Sep 17, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Sep 17, 2023
@zkteco-home
Copy link

same issue

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

No branches or pull requests

4 participants