@momo-kits/native-kits 0.156.1-sp.2-debug → 0.156.1-sp.3-debug
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/compose/build.gradle.kts
CHANGED
package/gradle.properties
CHANGED
package/ios/Input/Input.swift
CHANGED
|
@@ -29,8 +29,9 @@ public struct Input: View {
|
|
|
29
29
|
public var onBlur: (() -> Void)?
|
|
30
30
|
public var onRightIconPressed: (() -> Void)?
|
|
31
31
|
|
|
32
|
-
@
|
|
32
|
+
@State private var isFocused: Bool = false
|
|
33
33
|
@State private var isPasswordHidden: Bool = true
|
|
34
|
+
@FocusState private var isTextFieldFocused: Bool
|
|
34
35
|
|
|
35
36
|
public init(
|
|
36
37
|
text: Binding<String>,
|
|
@@ -132,7 +133,7 @@ public struct Input: View {
|
|
|
132
133
|
.foregroundColor(getTextColor())
|
|
133
134
|
.disabled(disabled || readOnly)
|
|
134
135
|
.applyPrimaryCursorColor()
|
|
135
|
-
.focused($
|
|
136
|
+
.focused($isTextFieldFocused)
|
|
136
137
|
.onChange(of: text) { newValue in
|
|
137
138
|
onChangeText?(newValue)
|
|
138
139
|
}
|
|
@@ -145,7 +146,7 @@ public struct Input: View {
|
|
|
145
146
|
.foregroundColor(getTextColor())
|
|
146
147
|
.disabled(disabled || readOnly)
|
|
147
148
|
.applyPrimaryCursorColor()
|
|
148
|
-
.focused($
|
|
149
|
+
.focused($isTextFieldFocused)
|
|
149
150
|
.onChange(of: text) { newValue in
|
|
150
151
|
onChangeText?(newValue)
|
|
151
152
|
}
|
|
@@ -206,11 +207,11 @@ public struct Input: View {
|
|
|
206
207
|
.onAppear {
|
|
207
208
|
if autofocus {
|
|
208
209
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
|
|
209
|
-
|
|
210
|
+
isTextFieldFocused = true
|
|
210
211
|
}
|
|
211
212
|
}
|
|
212
213
|
}
|
|
213
|
-
.onChange(of:
|
|
214
|
+
.onChange(of: isTextFieldFocused) { newValue in
|
|
214
215
|
isFocused = newValue
|
|
215
216
|
if newValue {
|
|
216
217
|
onFocus?()
|
|
@@ -224,6 +225,7 @@ public struct Input: View {
|
|
|
224
225
|
|
|
225
226
|
private func handleFocusChange(_ focused: Bool) {
|
|
226
227
|
isFocused = focused
|
|
228
|
+
isTextFieldFocused = focused
|
|
227
229
|
if focused {
|
|
228
230
|
onFocus?()
|
|
229
231
|
} else {
|
|
@@ -22,7 +22,8 @@ public struct InputPhoneNumber: View {
|
|
|
22
22
|
public var onBlur: (() -> Void)?
|
|
23
23
|
public var onRightIconPressed: (() -> Void)?
|
|
24
24
|
|
|
25
|
-
@
|
|
25
|
+
@State private var isFocused: Bool = false
|
|
26
|
+
@FocusState private var isTextFieldFocused: Bool
|
|
26
27
|
|
|
27
28
|
public init(
|
|
28
29
|
text: Binding<String>,
|
|
@@ -86,7 +87,7 @@ public struct InputPhoneNumber: View {
|
|
|
86
87
|
.foregroundColor(Colors.black17)
|
|
87
88
|
.applyPrimaryCursorColor()
|
|
88
89
|
.lineLimit(1)
|
|
89
|
-
.focused($
|
|
90
|
+
.focused($isTextFieldFocused)
|
|
90
91
|
.onChange(of: text) { newValue in
|
|
91
92
|
onChangeText?(newValue)
|
|
92
93
|
}
|
|
@@ -136,7 +137,7 @@ public struct InputPhoneNumber: View {
|
|
|
136
137
|
if autofocus {
|
|
137
138
|
// Small delay to ensure the view is fully loaded
|
|
138
139
|
DispatchQueue.main.asyncAfter(deadline: .now() + 0.1) {
|
|
139
|
-
|
|
140
|
+
isTextFieldFocused = true
|
|
140
141
|
}
|
|
141
142
|
}
|
|
142
143
|
}
|
|
@@ -146,6 +147,7 @@ public struct InputPhoneNumber: View {
|
|
|
146
147
|
|
|
147
148
|
private func handleFocusChange(_ focused: Bool) {
|
|
148
149
|
isFocused = focused
|
|
150
|
+
isTextFieldFocused = focused
|
|
149
151
|
if focused {
|
|
150
152
|
onFocus?()
|
|
151
153
|
} else {
|