We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3823cb7 commit 42f064cCopy full SHA for 42f064c
Projects/Shared/ViewUtil/Sources/View+onSuccess.swift
@@ -1,8 +1,11 @@
1
import SwiftUI
2
3
public extension View {
4
- func onSuccess(of value: Bool, _ action: () -> Void) -> some View {
5
- if value { action() }
6
- return self
+ func onSuccess(of value: Bool, _ action: @escaping () -> Void) -> some View {
+ self.onChange(of: value) { changedValue in
+ if changedValue {
7
+ action()
8
+ }
9
10
}
11
Projects/UserInterface/DesignSystem/Sources/TextField/KGTextField.swift
@@ -69,6 +69,9 @@ public struct KGTextField: View {
69
lineWidth: 1
70
)
71
72
+ .onTapGesture {
73
+ self.isFocused = true
74
75
76
if !description.isEmpty || isErrorAndNotEmpty {
77
Text(isErrorAndNotEmpty ? errorMessage : description)
0 commit comments