Skip to content

Commit e02a3ca

Browse files
committed
fix(ios): respect scrollEnabled false
1 parent d2dee5e commit e02a3ca

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

ios/PagerView.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ struct PagerView: View {
3838
collectionView.delegate = scrollDelegate
3939
}
4040
}
41+
.onAppear {
42+
// Apply initial prop values that .onChange won't catch
43+
// (.onChange only fires on changes, not on initial values)
44+
DispatchQueue.main.async {
45+
collectionView?.isScrollEnabled = props.scrollEnabled
46+
collectionView?.bounces = props.overdrag
47+
}
48+
}
4149
.onChange(of: props.children) { newValue in
4250
if props.currentPage >= newValue.count && !newValue.isEmpty {
4351
props.currentPage = newValue.count - 1

0 commit comments

Comments
 (0)