wix / react-native-calendars

React Native Calendar Components 🗓️ 📆
MIT License
9.42k stars 2.92k forks source link

CalendarList initialDate not scrolling and replacing all months #2466

Open cruzms opened 3 months ago

cruzms commented 3 months ago

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

image

Environment

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

Also specify:

  1. 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

donPindyukel commented 2 months ago

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

image
bradbyte commented 1 month ago

I'm also having this issue.