wix / react-native-calendars

React Native Calendar Components 🗓️ 📆
MIT License
9.58k stars 2.96k forks source link

Agenda scroll stuck (When passtScrollRange = 0) #222

Open bohdanbirdie opened 7 years ago

bohdanbirdie commented 7 years ago

Description

Scroll view that wraps months in Agenda do not scroll to the top after pulling knob if pastScrollRange prop was set to 0 for Agenda component, it will scroll automatically to the top if we will begin scrolling manually.

Expected Behavior

Should scroll to the top of all months or until last selected month will touch top line.

Observed Behavior

2017-11-05 00 10 38


  <Agenda
          items={this.getItems()}
          loadItemsForMonth={(month) => {console.log('trigger items loading')}}
          onDayPress={(day)=>{console.log('day pressed')}}
          onDayChange={(day)=>{console.log('day changed')}}
          selected={moment().format('YYYY-MM-DD')}
          minDate={this.state.startedAt}
          maxDate={'2017-11-25'}
          pastScrollRange={0}
          futureScrollRange={3}
          renderItem={this.renderItem.bind(this)}
          renderEmptyDate={this.renderEmptyDate.bind(this)}
          rowHasChanged={(r1, r2) => {return r1.text !== r2.text}}
          markedDates={{
            '2017-11-03': {selected: true, marked: true, color: 'green'},
            '2017-11-04': {marked: true},
            '2017-11-05': {disabled: true},
            '2017-11-18': {marked: true},
          }}
          style={{backgroundColor: 'red', borderBottomColor: '#FFFFFF', borderBottomWidth: 1, height: (this.height-245),}}
          theme={{height: 400, backgroundColor: 'yellow'}}
        />

"react-native": "0.49.3", "react-native-calendars": "^1.9.0",

dotansimha commented 7 years ago

Same here! with 1.9.1 / RN 0.49.5