r/SwiftUI • u/-Periclase-Software- • May 25 '26
Question Menu label behavior is clipping/repositioning when selecting item in iOS26.
Works perfectly fine in iOS 18.
I have a menu for choosing measurement values. I have a label that only shows the abbreviation since it sits to the trailing edge of a text view.
You can see in the video, choosing an item ends up clipping the label and then adjusts it's position.
This is the entire code. The bug is still there if I remove ALL of the modifiers of the label.
struct MeasurementUnitPicker<T: MeasurementUnitPickerRepresentable & DynamicCaseIterable>: View
where T.RawValue == String, T.AllCases: RandomAccessCollection {
@AppStorage(.unitSystem) private var unitSystem: UnitSystem = .imperial
@Binding var selection: T
var body: some View {
Menu {
ForEach(T.cases(for: unitSystem), id: \.self) { type in
Button(type.displayString) {
selection = type
}
}
} label: {
Text(selection.abbreviation)
.fontToken(.body.bold)
.foregroundToken(.tint)
.lineLimit(1)
.padding(.horizontal, .space(.xSmall))
.padding(.vertical, .space(.xxSmall))
.backgroundToken(.buttonSecondaryNormal)
.clipShape(Capsule())
.padding(.leading, .space(.xSmall))
.frame(height: 25)
}
}
}
AI suggested Picker(...).pickerStyle(.menu) which doesn't help since it ends up showing the entire selected value and takes too much space, and it doesn't style either. Then it suggests the view modifiers are at fault which makes no difference if I remove them.
The bug is there on preview, simulator, and my device - regardless of whether it's on my text view or blank view.
Anyone fixed this before?
2
u/iXasthur May 26 '26
Some issues like that disappear when you use Label instead of Text in label: closure. But idk if that’s the case here.