When .buttonStyle is applied in the code below, I expect it to apply the style to button created by DestinationLink, but destination view shouldn't be decorated.
Since we have a wrapper around DestinationLink, I can easily apply .buttonStyle(.plain) to destination to prevent such issue, but not sure if this behavior is expected - it changed between 1.1.0 and 1.1.2.
struct ContentView: View {
@State var presented = false
var body: some View {
NavigationView {
DestinationLink {
ViewToDismiss()
} label: {
Text("show")
}
.buttonStyle(.bordered)
}
}
}
struct ViewToDismiss: View {
@Environment(\.destinationCoordinator) var destinationCoordinator
var body: some View {
Button("Dismiss") {
destinationCoordinator.pop()
}
}
}
When
.buttonStyle
is applied in the code below, I expect it to apply the style to button created byDestinationLink
, but destination view shouldn't be decorated.Since we have a wrapper around
DestinationLink
, I can easily apply.buttonStyle(.plain)
to destination to prevent such issue, but not sure if this behavior is expected - it changed between 1.1.0 and 1.1.2.