Skip to content

Commit 42f064c

Browse files
committed
✨ :: onSuccess 로직 수정
1 parent 3823cb7 commit 42f064c

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
import SwiftUI
22

33
public extension View {
4-
func onSuccess(of value: Bool, _ action: () -> Void) -> some View {
5-
if value { action() }
6-
return self
4+
func onSuccess(of value: Bool, _ action: @escaping () -> Void) -> some View {
5+
self.onChange(of: value) { changedValue in
6+
if changedValue {
7+
action()
8+
}
9+
}
710
}
811
}

Projects/UserInterface/DesignSystem/Sources/TextField/KGTextField.swift

+3
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ public struct KGTextField: View {
6969
lineWidth: 1
7070
)
7171
}
72+
.onTapGesture {
73+
self.isFocused = true
74+
}
7275

7376
if !description.isEmpty || isErrorAndNotEmpty {
7477
Text(isErrorAndNotEmpty ? errorMessage : description)

0 commit comments

Comments
 (0)