Originally posted by shirelzz April 21, 2026
I'm experiencing an issue with TabView when using a selection binding together with .tabViewStyle(.page) on Android.
When switching from the second page (index 1) back to the first page (index 0), the view briefly changes but then immediately jumps back to the second page. This makes it impossible to navigate backward. This happens only when switching from index 1 to 0, swiping between 1 and 2 indexes works as expected.
Code example:
TabView(selection: $page) {
page1.tag(mode.menu)
page2.tag(mode.content)
page3.tag(mode.related)
}
.tabViewStyle(.page(indexDisplayMode: .never))
When I remove the selection binding, swipe gestures between pages work correctly and feel stable. However, I lose the ability to programmatically change the current page (e.g., when tapping buttons inside each page), since the TabView is no longer controlled by state.
Are there any recommended workarounds for a stable paging behavior?
Thanks!
Discussed in https://github.com/orgs/skiptools/discussions/670
Originally posted by shirelzz April 21, 2026
I'm experiencing an issue with TabView when using a selection binding together with .tabViewStyle(.page) on Android.
When switching from the second page (index 1) back to the first page (index 0), the view briefly changes but then immediately jumps back to the second page. This makes it impossible to navigate backward. This happens only when switching from index 1 to 0, swiping between 1 and 2 indexes works as expected.
Code example:
When I remove the selection binding, swipe gestures between pages work correctly and feel stable. However, I lose the ability to programmatically change the current page (e.g., when tapping buttons inside each page), since the TabView is no longer controlled by state.
Are there any recommended workarounds for a stable paging behavior?
Thanks!