Skip to content

Commit

Permalink
Check page before updating #patch
Browse files Browse the repository at this point in the history
  • Loading branch information
fermoya committed Dec 22, 2020
1 parent ea83d9d commit 2e3b566
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Sources/SwiftUIPager/Pager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ public struct Pager<Element, ID, PageView>: View where PageView: View, Element:
self.content(for: proxy.size)
.environmentObject(pagerModel)
.onReceive(pagerModel.$page) { (page) in
guard self.page != page else { return }
self.page = page
}
}
Expand Down

0 comments on commit 2e3b566

Please sign in to comment.