mirror of
https://github.com/ProtonMail/ios-mail.git
synced 2026-06-14 09:54:45 +00:00
Drop view highlighting for iOS 17 to fix the problem with scrolling
This commit is contained in:
committed by
MargeBot
parent
9dd5804f79
commit
18b2a66166
@@ -45,9 +45,31 @@ public struct LongPressFormBigButton: View {
|
||||
symbol: .none
|
||||
)
|
||||
.textSelection(.enabled)
|
||||
.onLongPressGesture(perform: {}, onPressingChanged: { changed in isPressed = changed })
|
||||
.conditionalLongPress(onPressingChanged: { changed in isPressed = changed })
|
||||
.onTapGesture(perform: onTap)
|
||||
.background(isPressed && hasAccentTextColor ? DS.Color.InteractionWeak.pressed : .clear)
|
||||
.background(DS.Color.BackgroundInverted.secondary)
|
||||
}
|
||||
}
|
||||
|
||||
private extension View {
|
||||
|
||||
func conditionalLongPress(onPressingChanged: ((Bool) -> Void)?) -> some View {
|
||||
modifier(ConditionalLongPress(onPressingChanged: onPressingChanged))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private struct ConditionalLongPress: ViewModifier {
|
||||
let onPressingChanged: ((Bool) -> Void)?
|
||||
|
||||
func body(content: Content) -> some View {
|
||||
if #available(iOS 18, *) {
|
||||
content
|
||||
.onLongPressGesture(perform: {}, onPressingChanged: onPressingChanged)
|
||||
} else {
|
||||
content
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user