We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d2dee5e commit e02a3caCopy full SHA for e02a3ca
1 file changed
ios/PagerView.swift
@@ -38,6 +38,14 @@ struct PagerView: View {
38
collectionView.delegate = scrollDelegate
39
}
40
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
49
.onChange(of: props.children) { newValue in
50
if props.currentPage >= newValue.count && !newValue.isEmpty {
51
props.currentPage = newValue.count - 1
0 commit comments