Skip to content

fix(month-mode): remove unnecessary setPage call in onPressCell handler#1168

Open
LeeSeongJinCa wants to merge 1 commit into
acro5piano:mainfrom
LeeSeongJinCa:fix/force-set-page-issue
Open

fix(month-mode): remove unnecessary setPage call in onPressCell handler#1168
LeeSeongJinCa wants to merge 1 commit into
acro5piano:mainfrom
LeeSeongJinCa:fix/force-set-page-issue

Conversation

@LeeSeongJinCa
Copy link
Copy Markdown

  • Eliminate calendarRef.current?.setPage(0, { animated: true }) invocation triggered by cell presses in month mode
  • Keep the original onPressCell logic intact

- Eliminate `calendarRef.current?.setPage(0, { animated: true })` invocation triggered by cell presses in month mode
- Keep the original `onPressCell` logic intact
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 7, 2025

@LeeSeongJinCa is attempting to deploy a commit to the Kazuya Gosho's projects Team on Vercel.

A member of the Team first needs to authorize it.

@LeeSeongJinCa
Copy link
Copy Markdown
Author

Hi, thank you for your great work on this component!

I'm currently using version 5.0.0-beta.2, and I noticed that in the month mode of the CalendarContainer component, the onPressCell callback includes the line:

calendarRef.current?.setPage(0, { animated: true })

However, I'm not sure why this call is necessary. In my case, this causes an issue where tapping on a cell from a different month always resets the calendar back to the first page, which disrupts the user experience.

Unless this line is required for a specific purpose, I believe it would be helpful to consider removing it in this PR to avoid unexpected behavior.

Thanks again, and please let me know if there's any context I might be missing!

@acro5piano
Copy link
Copy Markdown
Owner

Hi @LeeSeongJinCa Thank you for your suggestion!

@msvalandro Can you take a look at the proposed change? You updated the code in this commit and both looks reasonable...
38d1c5b#diff-ed5a8ad97ebd0edfe763865278ced148c8937c4515fbcbd307db476333b08ff3L369-R382

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 12, 2025

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

Name Status Preview Comments Updated (UTC)
react-native-big-calendar ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 12, 2025 6:38am

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants