Fix bug in InlineTextButton

This commit is contained in:
Alfonso Grillo
2022-10-26 15:56:32 +02:00
parent a6c2a8ae63
commit f1f573ab50
@@ -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
}
}
}