Submission Date
20216-07-16
Status
Open
Area
SwiftUI
Operating System Version
iOS 26.5
Type
Incorrect/Unexpected Behavior
Description
Steps to reproduce (example below)
Setup a container view setting a custom primary and secondary foreground style (blue and orange).
Add a Text with .foregroundStyle(.secondary)
Expected behaviour
The text should use the secondary foreground style (orange) that is set on its parent view, matching the behaviour of calling the same modifier on other views (Button, Label, etc) or containers containing text (HStack, Group, etc).
Actual Behaviour
The text uses the secondary style of the primary foreground style (faded blue).
Example
var text: some View {
Text("Secondary")
}
#Preview {
VStack {
Section("Actual") {
Text("Modified Primary").foregroundStyle(.secondary)
}
Divider()
Section("Expected") {
text.foregroundStyle(.secondary)
HStack { Text("Secondary") }.foregroundStyle(.secondary)
Group { Text("Secondary") }.foregroundStyle(.secondary)
AnyView(Text("Secondary")).foregroundStyle(.secondary)
Button("Secondary") {}.foregroundStyle(.secondary)
}
}
.foregroundStyle(.blue, .orange)
}
Keywords
No response
Prerequisites
Submission Date
20216-07-16
Status
Open
Area
SwiftUI
Operating System Version
iOS 26.5
Type
Incorrect/Unexpected Behavior
Description
Steps to reproduce (example below)
Setup a container view setting a custom primary and secondary foreground style (blue and orange).
Add a Text with .foregroundStyle(.secondary)
Expected behaviour
The text should use the secondary foreground style (orange) that is set on its parent view, matching the behaviour of calling the same modifier on other views (Button, Label, etc) or containers containing text (HStack, Group, etc).
Actual Behaviour
The text uses the secondary style of the primary foreground style (faded blue).
Example
Keywords
No response
Prerequisites
FB<number>: <title>