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

Agenda List View upward scroll beyond selectedDate not working

Open shabnam701 opened this issue 6 years ago • 10 comments

  <Agenda
      items={this.state.prefilled}
       onDayPress={this.onDayPress}
       onDayChange={this.onDayPress}
       selected={this.state.selectedDate}
       renderItem={this.renderItem.bind(this)}
       renderEmptyDate={this.renderEmptyDate.bind(this)}
       rowHasChanged={this.rowHasChanged.bind(this)}
       minDate={getFirstDateOfCurrentMonth()}
       maxDate={getLastDateOfCurrentMonth()}
       pastScrollRange={1}
       futureScrollRange={1}
       disabledByDefault={true}
       markedDates={currentMonthPrefilled}
/>
  onDayPress = day => {
    console.log('selected', day)
      this.setState({
        selectedDate: day
      })
  }

I update selectedDate on day press in Agenda

Current Behaviour : Updward scroll the Agenda List beyond selected date is not working Expected Behaviour : Component shouble be able to scroll the Agenda List between minDate and maxDate

shabnam701 avatar Feb 19 '20 06:02 shabnam701

i can't set new selected date after first render too.

devsoft1999 avatar Feb 20 '20 09:02 devsoft1999

I am not sure what is the problem. can you please upload a video?

I tried to use your onDayPress function and everything works fine. Did you notice that you limit the months you can scroll?

       pastScrollRange={1}
       futureScrollRange={1}

chenei avatar Jun 02 '20 14:06 chenei

ezgif com-video-to-gif

@chenei, when I select or set default today date, is it not scroll Upward.

shahrajk avatar Jun 19 '20 13:06 shahrajk

This is the Agenda behaviour. We asked many times to support this but we didn’t had the time to implement this feature.

Chen Eilat - Chat @ Spike [k5nod]

On June 19, 2020 at 13:09 GMT, rajshah [email protected] wrote:

ezgif com-video-to-gif

@chenei, when I select or set default today date, is it not scroll.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

chenei avatar Jun 19 '20 13:06 chenei

@shabnam701 How did you manage to add the items and show the days even if there are no events? Could I see your example to guide me in it?

gerahrios avatar Aug 05 '20 17:08 gerahrios

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 Dec 02 '20 13:12 stale[bot]

still having same issue

Arslan106 avatar Dec 17 '20 10:12 Arslan106

I am also having this issue. It would be really nice to be able to scroll into the past and not be limited to just going into the future past the selected date.

higgsboz avatar Dec 18 '20 13:12 higgsboz

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 Mar 18 '21 14:03 stale[bot]

In my case I had the same problem and the project client wanted that behavior, my solution:

Implement a custom list component to replace the one used by the library using the renderList property.

This solved the bidirectional scrolling but created new problems:

  • The automatic scrolling behavior of the calendar dates did not work, this was somewhat annoying, but it was solved.
  • The data format was no longer supported.
  • The markedDates now had to be generated manually.

and generate other benefits:

  • Having more control over this component allowed us to establish a better data format than the one used by the library and several performance problems related to the gradual increase of data were solved.

So you should keep this in mind when making a decision.

NicolasNinoViancha avatar Dec 16 '23 15:12 NicolasNinoViancha