Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ios/PagerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ struct PagerView: View {
collectionView.delegate = scrollDelegate
}
}
.onAppear {
// Apply initial prop values that .onChange won't catch
// (.onChange only fires on changes, not on initial values)
DispatchQueue.main.async {
collectionView?.isScrollEnabled = props.scrollEnabled
collectionView?.bounces = props.overdrag
}
}
.onChange(of: props.children) { newValue in
if props.currentPage >= newValue.count && !newValue.isEmpty {
props.currentPage = newValue.count - 1
Expand Down
Loading