diff --git a/Packages/ComposeUI/Sources/ComposeUI/Views/DraftContentEditor.swift b/Packages/ComposeUI/Sources/ComposeUI/Views/DraftContentEditor.swift index 0d25936c5a..cfed3e4370 100644 --- a/Packages/ComposeUI/Sources/ComposeUI/Views/DraftContentEditor.swift +++ b/Packages/ComposeUI/Sources/ComposeUI/Views/DraftContentEditor.swift @@ -87,11 +87,26 @@ private struct LanguageButtonStyle: ButtonStyle { .padding(.vertical, 2) .padding(.horizontal, 4) .background(.tint.opacity(configuration.isPressed ? 0.15 : 0.2), in: RoundedRectangle(cornerRadius: 3)) - .animation(.linear(duration: 0.1), value: configuration.isPressed) + .modifier(LanguageButtonStyleAnimationModifier(isPressed: configuration.isPressed)) .padding(2) } } +@available(iOS, obsoleted: 16.0) +private struct LanguageButtonStyleAnimationModifier: ViewModifier { + let isPressed: Bool + + func body(content: Content) -> some View { + // This looks weird while the button is being pressed on iOS 15 for some reason. + if #available(iOS 16.0, *) { + content + .animation(.linear(duration: 0.1), value: isPressed) + } else { + content + } + } +} + private struct TogglePollButton: View { @ObservedObject var draft: Draft @FocusState.Binding var focusedField: FocusableField?