skiptools / skiptools/skip-ui

Missing Tabs: TabViews must-be configured at the outer level on SKIP-Android

Open
#61 0 comments 0 reactions 0 assignees View on GitHub

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:
Screenshot with Android's solo working tab on the left, and iOS' full set of working tabs on the right

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.