diff --git a/iOS/SwiftUI Extensions/VibrantSelectAction.swift b/iOS/SwiftUI Extensions/VibrantSelectAction.swift index 0660b5450..50625f181 100644 --- a/iOS/SwiftUI Extensions/VibrantSelectAction.swift +++ b/iOS/SwiftUI Extensions/VibrantSelectAction.swift @@ -15,21 +15,25 @@ struct VibrantSelectAction: ViewModifier { @GestureState var isLongPressed = false func body(content: Content) -> some View { - content - .foregroundColor(isLongPressed || isTapped ? Color(AppAssets.tableViewCellHighlightedTextColor) : .primary) - .listRowBackground(isLongPressed || isTapped ? Color(AppAssets.tableViewCellSelectionColor) : nil) - .gesture( - LongPressGesture().onEnded( { _ in self.action() }) - .updating($isLongPressed) { value, state, transcation in state = value } - .simultaneously(with: - TapGesture().onEnded( { - self.isTapped = true - self.action() - DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) { - self.isTapped = false - } - }) - ) + GeometryReader { geometry in + content + .frame(width: geometry.size.width, height: geometry.size.height, alignment: .leading) + .background(self.isLongPressed || self.isTapped ? Color(AppAssets.tableViewCellSelectionColor) : Color(.secondarySystemGroupedBackground)) + } + .foregroundColor(isLongPressed || isTapped ? Color(AppAssets.tableViewCellHighlightedTextColor) : .primary) + .listRowBackground(isLongPressed || isTapped ? Color(AppAssets.tableViewCellSelectionColor) : nil) + .gesture( + LongPressGesture().onEnded( { _ in self.action() }) + .updating($isLongPressed) { value, state, transcation in state = value } + .simultaneously(with: + TapGesture().onEnded( { + self.isTapped = true + self.action() + DispatchQueue.main.asyncAfter(deadline: .now() + 0.05) { + self.isTapped = false + } + } + )) ) }