Fix bug in InlineTextButton

This commit is contained in:
Alfonso Grillo
2022-10-26 15:56:32 +02:00
parent 066277d972
commit ce83f911ce
@@ -69,8 +69,13 @@ struct InlineTextButton: View {
func makeBody(configuration: Configuration) -> some View {
components.reduce(Text("")) { lastValue, component in
lastValue + Text(component.string)
.foregroundColor(component.isTinted ? .accentColor.opacity(configuration.isPressed ? 0.2 : 1) : nil)
var text: Text = .init(component.string)
if component.isTinted {
text = text.foregroundColor(.accentColor.opacity(configuration.isPressed ? 0.2 : 1))
}
return lastValue + text
}
}
}