Missing Tabs: TabViews must-be configured at the outer level on SKIP-Android
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 330
- Forks
- 76
- Avg merge
- 3h 6m
- Merged PRs (30d)
- 1
Description
On Android-only, tabs where the tab item is configured inside a helper struct do not appear.
Tab-buttons only appear if .tabItem {…} is specified on the outermost view -- it must be a direct child view of the TabView
Example code:
struct MainNavigation: View {
var body: some View {
TabView {
Text("Tab 1 - This works!")
.tabItem {
Label("Tab 1", systemImage: "heart.fill")
}
.tag("tab1")
Tab2()
}
}
}
struct Tab2: View {
var body: some View {
Text("Tab 2 - This Fails on Android!")
.tabItem {
Label("Tab 2", systemImage: "xmark")
}
.tag("tab2")
}
}
Screenshot with a couple extra tabs:
I suspect something about TabModifierView needs an update? https://github.com/skiptools/skip-ui/blob/58e0fc7318f1e8e361aa7093e29b188698d76841/Sources/SkipUI/SkipUI/Containers/TabView.swift#L325-L358
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the TabModifierView code at Sources/SkipUI/SkipUI/Containers/TabView.swift lines 325-358. Reproduce the issue on SKIP-Android using the MainNavigation and Tab2 example, comparing a direct tab item with one configured inside a helper view. Done means tabs defined in helper structs appear alongside directly configured tabs on Android.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, swift
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100