Agenda items scrolling doesn't work in Android
See original GitHub issueDescription
I use Agenda
component and cannot scroll list of items in Android. Scrolling works well in iOS.
Expected Behavior
If I scroll down, I should see other items from the list, but scrolling doesn’t work.
Observed Behavior
I don’t see any error messages.
Environment
npm ls react-native-calendars
: 1.17.3npm ls react-native
: 0.54.2
Also specify:
- Phone/emulator/simulator & version: Google Nexus 5X - 8.0 - API 26 - 1080x1920/ Genymotion 2.12.0
Reproducible Demo
<View style={{ flex: 1 }}>
<ScrollView>
<RefreshControl refreshing={this.state.refreshing} onRefresh={this._onRefresh.bind(this)} />
<View style={styles.container}>
<Agenda
ref={(component) => (this.agenda = component)}
items={formatedCalendar}
selected={currentDay}
renderItem={this.renderItem.bind(this)}
firstDay={1}
pastScrollRange={3}
futureScrollRange={3}
onDayChange={(day) => {
// Always future.
const actualDate = moment(day.dateString, 'YYYY-MM-DD');
const diff = moment.duration(actualDate.diff(this.state.currentDate));
if (diff.asDays() > 7) {
// Update currentDate to today.
this.props.getCalendarDays(actualDate, 7, this.state.filter);
this.setState({ currentDate: actualDate });
}
}}
onCalendarToggled={(calendarOpened) => {
this.setState({ calendarOpened });
}}
onDayPress={this._onDayPress.bind(this)}
scrollEnabled
markedDates={markedDates}
renderDay={this.renderDay.bind(this)}
renderEmptyData={this.renderEmptyData.bind(this)}
rowHasChanged={this.rowHasChanged.bind(this)}
monthFormat="MMMM"
/>
</View>
</ScrollView>
</View>;
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top Results From Across the Web
Scrolling issues with GridView in Android - Stack Overflow
The problem is that GridView does not currently handle items with differing heights. My solution is to use exactly specified layout_height same for...
Read more >Inline View not scrolling on Android | Xamarin.Forms Forums
I am using SfCalendar version 18.2.0.59 in Xamarin Forms, however, the inline view that shows the appointments as a list is not scrolling...
Read more >Use RecyclerView to display a scrollable list
When a list item is scrolled off the screen, RecyclerView reuses that view for the next list item about to be displayed.
Read more >Android RecyclerView Load More, Endless Scrolling
Android RecyclerView Load More · In order to show Loading icon at the bottom of RecyclerView while the next set of items are...
Read more >PLEASE HELP - Excel Horizontal Scroll Not Working
Hello all: I have an excel workbook that is many columns wide. I am on a Macbook Pro, Office 365. Scroll lock is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I don’t think this issue should be closed. Please create a PR if you find the time but the feature seems important enough to keep this issue open.
I wanted to achieve a functionality, where you can pull to refresh agenda component to refresh the view. RefreshControl needs to be inside
ScrollView or ListView
andAgenda
already containsScrollView
, so my code snippet works for iOS, but in Android I cannot scroll the Agenda.I created separated components for iOS and Android. Here you can see how it works (I removed parent
ScrollView
andRefreshControl
for Android component to makeAgenda
scrollable)If you want to achieve in Android what you see in iOS, you need to implement
RefreshControl
in two places.RefreshControl
inScrollView
inAgenda
component, I guess somewhere hereRefreshControl
for whole view (screen). I tried PullView component and it works.This is how it works if you implement only 2), so pull to refresh works only if you pull the calendar, but not if you pull the list items. My client is okay with this solution, because Android is not priority, but I am writing this here if someone will come across similar issue.