BugiDev / react-native-calendar-strip

Easy to use and visually stunning calendar component for React Native.
MIT License
949 stars 327 forks source link

Date disappear when selected on android #238

Closed safwentrabelsi closed 3 years ago

safwentrabelsi commented 3 years ago

Date disappear when selected on android 126860407_762164497702148_3410939019826670620_n

<CalendarStrip
          scrollable
          style={styles.calendar}
          showMonth={false}
          calendarColor={'#FFFFFF'}
          calendarHeaderStyle={{color: 'black'}}
          dateNumberStyle={{color: 'black'}}
          dateNameStyle={{color: 'black'}}
          iconContainer={{flex: 0.1}}
          daySelectionAnimation={{
            type: 'background',

            highlightColor: '#d3d3d3',
          }}
          selectedDate={selectedDate}
          onDateSelected={this.onDateSelected}
          markedDates={date => {
            if (date.dayOfYear() === moment().dayOfYear()) {
              return {
                dots: [
                  {
                    color: 'black',
                  },
                ],
              };
            }
          }}
        />
josue-castro commented 3 years ago

Im using react-native with expo and I just noticed I have this same issue on android. I need some quick fixing for school project. When I select a date it disappears but then if I select another the previous one is visible again.

I even set the following props in case the default highlight was white, but it did not work. My calendar background color is white. highlightDateNameStyle={'black'} highlightDateNumberStyle={'black'}

gaurav0044 commented 3 years ago

Date disappear when selected on android 126860407_762164497702148_3410939019826670620_n

<CalendarStrip
          scrollable
          style={styles.calendar}
          showMonth={false}
          calendarColor={'#FFFFFF'}
          calendarHeaderStyle={{color: 'black'}}
          dateNumberStyle={{color: 'black'}}
          dateNameStyle={{color: 'black'}}
          iconContainer={{flex: 0.1}}
          daySelectionAnimation={{
            type: 'background',

            highlightColor: '#d3d3d3',
          }}
          selectedDate={selectedDate}
          onDateSelected={this.onDateSelected}
          markedDates={date => {
            if (date.dayOfYear() === moment().dayOfYear()) {
              return {
                dots: [
                  {
                    color: 'black',
                  },
                ],
              };
            }
          }}
        />

i have a same problem

josue-castro commented 3 years ago

Im using react-native with expo and I just noticed I have this same issue on android. I need some quick fixing for school project. When I select a date it disappears but then if I select another the previous one is visible again.

I even set the following props in case the default highlight was white, but it did not work. My calendar background color is white. highlightDateNameStyle={'black'} highlightDateNumberStyle={'black'}

Well for some reason I just tried this again and it work. If your calendar color is white make sure to set a highlightDateNameStyle color. Try their expo snack and you can see it works on android. They have blue background and yellow on highlightDateNameStyle. Hope is not something that sometimes work and sometimes doesnt

gaurav0044 commented 3 years ago

Im using react-native with expo and I just noticed I have this same issue on android. I need some quick fixing for school project. When I select a date it disappears but then if I select another the previous one is visible again. I even set the following props in case the default highlight was white, but it did not work. My calendar background color is white. highlightDateNameStyle={'black'} highlightDateNumberStyle={'black'}

Well for some reason I just tried this again and it work. If your calendar color is white make sure to set a highlightDateNameStyle color. Try their expo snack and you can see it works on android. They have blue background and yellow on highlightDateNameStyle. Hope is not something that sometimes work and sometimes doesnt

still it's not working , when i select date then it will disappear whether it's white color or any other color.

ganesh-papola commented 3 years ago

@gaurav0044 any solutions?

peacechen commented 3 years ago

The example project in this repo uses Expo and date selection works properly. Check that your code is updating its local state correctly. https://github.com/BugiDev/react-native-calendar-strip/tree/master/example

Instructions to get the example running: https://github.com/BugiDev/react-native-calendar-strip#development-with-sample-application

HassanHaiderIX commented 3 years ago

@gaurav0044 any solutions? try adding this so that date changes back to original color once it is unselected dateNameStyle={{color: 'black'}} dateNumberStyle={{color: 'black'}}