File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
Sources/Intramodular/Text Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ public struct CocoaTextField<Label: View>: View {
12
12
typealias Rect = ( ( _ bounds: CGRect , _ original: CGRect ) -> CGRect )
13
13
14
14
public struct CharactersChange : Hashable {
15
+ public let currentText : String
15
16
public let range : NSRange
16
17
public let replacement : String
17
18
}
@@ -143,7 +144,7 @@ fileprivate struct _CocoaTextField<Label: View>: UIViewRepresentable {
143
144
shouldChangeCharactersIn range: NSRange ,
144
145
replacementString string: String
145
146
) -> Bool {
146
- configuration. onCharactersChange ( . init( range: range, replacement: string) )
147
+ configuration. onCharactersChange ( . init( currentText : textField . text ?? " " , range: range, replacement: string) )
147
148
}
148
149
149
150
func textFieldShouldReturn( _ textField: UITextField ) -> Bool {
You can’t perform that action at this time.
0 commit comments