fix: pace capsule animation glitch in trip options view
Adds contentTransition(.identity) to pace filter icon and text to prevent SwiftUI's default text morphing animation when changing pace filter (All/Packed/Moderate/Relaxed). Also adds animation(nil, value:) to disable animations on the capsule container. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1719,8 +1719,10 @@ struct TripOptionsView: View {
|
|||||||
HStack(spacing: 6) {
|
HStack(spacing: 6) {
|
||||||
Image(systemName: paceFilter.icon)
|
Image(systemName: paceFilter.icon)
|
||||||
.font(.caption)
|
.font(.caption)
|
||||||
|
.contentTransition(.identity)
|
||||||
Text(paceFilter.rawValue)
|
Text(paceFilter.rawValue)
|
||||||
.font(.subheadline)
|
.font(.subheadline)
|
||||||
|
.contentTransition(.identity)
|
||||||
Image(systemName: "chevron.down")
|
Image(systemName: "chevron.down")
|
||||||
.font(.caption2)
|
.font(.caption2)
|
||||||
}
|
}
|
||||||
@@ -1733,6 +1735,7 @@ struct TripOptionsView: View {
|
|||||||
Capsule()
|
Capsule()
|
||||||
.strokeBorder(paceFilter == .all ? Theme.textMuted(colorScheme).opacity(0.2) : Theme.warmOrange.opacity(0.3), lineWidth: 1)
|
.strokeBorder(paceFilter == .all ? Theme.textMuted(colorScheme).opacity(0.2) : Theme.warmOrange.opacity(0.3), lineWidth: 1)
|
||||||
)
|
)
|
||||||
|
.animation(nil, value: paceFilter)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user