@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.
@@ -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
- let limitedText = limitText(newValue)
99
- self.text = limitedText
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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.159.1-beta.17",
3
+ "version": "0.159.1-beta.18",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},