Skip to content

Fix extra leading space in YearPicker#42

Open
WZBbiao wants to merge 1 commit intombernson:mainfrom
WZBbiao:fix/year-picker-leading-space
Open

Fix extra leading space in YearPicker#42
WZBbiao wants to merge 1 commit intombernson:mainfrom
WZBbiao:fix/year-picker-leading-space

Conversation

@WZBbiao
Copy link

@WZBbiao WZBbiao commented Mar 2, 2026

Problem

The year picker in the Popular talks view (used both in the tvOS inline view and the iOS toolbar) shows extra leading space before the year number. This was caused by the Label("Year", systemImage: "calendar") displaying both the calendar icon and the "Year" text. In .pickerStyle(.menu), this results in the text appearing as unwanted padding before the selected year.

Fix

Added .labelStyle(.iconOnly) to the Picker, which makes the label closure render only the calendar icon without the "Year" text. This removes the extra leading space while keeping the visual calendar indicator.

Fixes #40.

The YearPicker was using Label("Year", systemImage: "calendar") which
displayed both the icon and the "Year" text. In the menu picker style
(used on both tvOS inline and iOS toolbar), this caused extra leading
space to appear before the year number since the label text was rendered
alongside the selected value.

Applying .labelStyle(.iconOnly) to the Picker removes the text portion
of the Label, showing only the calendar icon. This eliminates the extra
leading space while keeping the visual calendar indicator.

Fixes mbernson#40.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Year picker for popular talks has extra leading space

1 participant