react-native-calendars icon indicating copy to clipboard operation
react-native-calendars copied to clipboard

Custom dayComponent with big height makes Calendar jump to random places when scrolling through months

Open goxr3plus opened this issue 3 years ago • 3 comments

Please make our job easier by filling this template out to completion. If you're requesting a feature instead of reporting a bug, please feel free to skip the Environment and Reproducible Demo sections.

Description

Please watch the below youtube video to understand exactly :)

https://www.youtube.com/shorts/TBT8QSp2Thg

Expected Behavior

I expect the scrolling to be smooth

Observed Behavior

The scroll jumps all over the place

Environment

Please run these commands in the project folder and fill in their results:

Also specify:

  1. Device/emulator/simulator & OS version: Using real Android phone with Android 12

Reproducible Demo

Easy just implement custom dayComponent and add a view with a big min height ( for example 90px )

Screenshots

image

image

@Inbal-Tish

goxr3plus avatar May 02 '22 00:05 goxr3plus

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[bot] avatar Aug 10 '22 01:08 stale[bot]

@goxr3plus Try passing calendarHeight to the CalendarList component with the new calculated height (you can find it using the Inspector).

Inbal-Tish avatar Aug 10 '22 06:08 Inbal-Tish

I'm experiencing the same issue.

@Inbal-Tish can you clarify how the calendarHeight prop is meant to be used? The description of this prop in the docs is just "Dynamic calendar height". My custom dayComponent has a height of 40, so I tried passing calendarHeight={40} but this didn't work and made the scrolling behaviour totally broken.

I'm assuming that calendarHeight is meant to be passed a different kind of value, could you please clarify this?

jordanmkoncz avatar Sep 23 '22 03:09 jordanmkoncz

@jordanmkoncz The calendarHeight prop should be used to modify the Calendar's height, not the day's. You should calculate the required height as you enlarged the day component's height (the default height is 360, calculated for a 32 points day component). See the example in CalendarListScreen.tsx

Inbal-Tish avatar Sep 28 '22 10:09 Inbal-Tish

Me too facing the same issue, Please share some working solution.

jarvistesting avatar Oct 04 '22 05:10 jarvistesting

how to know if my calendar has 4 weeks or 5 weeks? Is there any parameter help me for calculate height?

frankA10019 avatar Nov 07 '22 09:11 frankA10019

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[bot] avatar Feb 11 '23 15:02 stale[bot]

.

goxr3plus avatar Feb 13 '23 13:02 goxr3plus

Hi, there! Is there any solution a with week rows count?
Also want to ask: maybe is it possible to disable auto-alignment when a date is selected? Because when I choose 1st day of any month - Calendar jumps to the previous month y some reason....

redjohnfrv avatar Feb 17 '23 05:02 redjohnfrv

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[bot] avatar May 20 '23 13:05 stale[bot]

.

dionart avatar May 24 '23 20:05 dionart

Same issue here

TNAJanssen avatar Aug 08 '23 08:08 TNAJanssen

same issue on my end :(

kamilkedzierski avatar Sep 21 '23 17:09 kamilkedzierski