@momo-kits/native-kits 0.159.1-beta.17 → 0.159.1-beta.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/Input/Input.swift +9 -4
- package/package.json +1 -1
package/ios/Input/Input.swift
CHANGED
|
@@ -95,12 +95,11 @@ public struct Input: View {
|
|
|
95
95
|
let textBinding = Binding<String>(
|
|
96
96
|
get: { self.text },
|
|
97
97
|
set: { newValue in
|
|
98
|
-
|
|
99
|
-
self.
|
|
100
|
-
self.onChangeText?(limitedText)
|
|
98
|
+
self.text = newValue
|
|
99
|
+
self.onChangeText?(limitText(newValue))
|
|
101
100
|
}
|
|
102
101
|
)
|
|
103
|
-
|
|
102
|
+
|
|
104
103
|
VStack(alignment: .leading, spacing: 4) {
|
|
105
104
|
ZStack(alignment: .topLeading) {
|
|
106
105
|
// Floating label
|
|
@@ -161,6 +160,12 @@ public struct Input: View {
|
|
|
161
160
|
.foregroundColor(getTextColor())
|
|
162
161
|
.disabled(disabled || readOnly)
|
|
163
162
|
.applyPrimaryCursorColor()
|
|
163
|
+
.onChange(of: text) { newValue in
|
|
164
|
+
let limited = limitText(newValue)
|
|
165
|
+
if limited != newValue {
|
|
166
|
+
text = limited
|
|
167
|
+
}
|
|
168
|
+
}
|
|
164
169
|
}
|
|
165
170
|
}
|
|
166
171
|
|