react-native-calendars
react-native-calendars copied to clipboard
CalendarList initialDate not scrolling and replacing all months
Description
When initialDate prop is set to CalendarList all visible months change to the initial
Expected Behavior
The months list should display correctly
Observed Behavior
Environment
Please run these commands in the project folder and fill in their results:
npm ls react-native-calendars: [email protected]npm ls react-native: 0.66.5
Also specify:
- Device/emulator/simulator & OS version:
Emulator: 8_Fold-out_API_30 Device: Redmi Note 7 Android 10
Reproducible Demo
import React from "react";
import { CalendarList } from "react-native-calendars";
export default function CalendarTest() {
return (
<CalendarList
initialDate="2024-08-11"
markedDates={{
"2024-08-10": { selected: true },
}}
onDayPress={(e) => {
console.log(e);
}}
/>
);
}
Screenshots
https://github.com/wix/react-native-calendars/assets/31360984/fe8ba7ee-87ba-4bfa-81c3-0b6745fb3f8d
I have same problem. I found this in the code, but I didn't understand what affects this 'visible' parameter:
react-native-calendars/src/calendar-list/item.js
I'm also having this issue.