react-native-controlled-input 0.19.0 → 0.21.0
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/android/src/main/java/com/controlledinput/ControlledInputView.kt +93 -181
- package/android/src/main/java/com/controlledinput/ControlledInputViewManager.kt +1 -0
- package/android/src/main/java/com/controlledinput/JetpackComposeView.kt +1 -0
- package/lib/module/ControlledInputViewNativeComponent.ts +2 -0
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/typescript/src/ControlledInputViewNativeComponent.d.ts +2 -0
- package/lib/typescript/src/ControlledInputViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ControlledInputViewNativeComponent.ts +2 -0
- package/src/index.tsx +3 -0
|
@@ -5,7 +5,6 @@ import android.util.AttributeSet
|
|
|
5
5
|
import android.util.Log
|
|
6
6
|
import android.util.TypedValue
|
|
7
7
|
import android.view.View
|
|
8
|
-
import android.view.ViewTreeObserver
|
|
9
8
|
import android.view.inputmethod.InputMethodManager
|
|
10
9
|
import android.widget.EditText
|
|
11
10
|
import android.widget.LinearLayout
|
|
@@ -68,114 +67,28 @@ class ControlledInputView : LinearLayout, LifecycleOwner {
|
|
|
68
67
|
private var windowLifecycleBound = false
|
|
69
68
|
|
|
70
69
|
/**
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
70
|
+
* Hidden [EditText] used only as KBC's [FocusedInputObserver.lastFocusedInput]: [syncUpLayout]
|
|
71
|
+
* reads [EditText]-scoped geometry. It is NOT focused and does not participate in the focus
|
|
72
|
+
* chain — we push state via reflection + synthetic selection events instead.
|
|
74
73
|
*/
|
|
75
|
-
private
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
* Layout height is 0 so LinearLayout ignores it visually. onLayout() forces its bounds to
|
|
86
|
-
* match ControlledInputView so keyboard-controller reads the correct width/height/position.
|
|
87
|
-
*/
|
|
88
|
-
private val focusProxy: EditText by lazy {
|
|
89
|
-
EditText(context).also { proxy ->
|
|
90
|
-
proxy.layoutParams = LayoutParams(0, 0)
|
|
91
|
-
// Must stay VISIBLE — Android's canTakeFocus() returns false for INVISIBLE/GONE views,
|
|
92
|
-
// causing requestFocus() to silently fail. Use alpha=0 to hide it visually instead.
|
|
93
|
-
proxy.alpha = 0f
|
|
94
|
-
proxy.isFocusableInTouchMode = true
|
|
95
|
-
proxy.showSoftInputOnFocus = false
|
|
96
|
-
proxy.isClickable = false
|
|
97
|
-
proxy.isCursorVisible = false
|
|
98
|
-
proxy.isLongClickable = false
|
|
74
|
+
private val kbcLayoutHost: EditText by lazy {
|
|
75
|
+
EditText(context).also { v ->
|
|
76
|
+
v.layoutParams = LayoutParams(0, 0)
|
|
77
|
+
v.alpha = 0f
|
|
78
|
+
v.isFocusable = false
|
|
79
|
+
v.isFocusableInTouchMode = false
|
|
80
|
+
v.showSoftInputOnFocus = false
|
|
81
|
+
v.isClickable = false
|
|
82
|
+
v.isCursorVisible = false
|
|
83
|
+
v.isLongClickable = false
|
|
99
84
|
}
|
|
100
85
|
}
|
|
101
86
|
|
|
102
|
-
private fun requestFocusProxy() {
|
|
103
|
-
val fontSize = viewModel.inputStyle.value?.fontSize?.toFloat()
|
|
104
|
-
Log.d(TAG, "──── requestFocusProxy ────")
|
|
105
|
-
Log.d(TAG, " fontSize=$fontSize")
|
|
106
|
-
Log.d(TAG, " proxy before: isFocused=${focusProxy.isFocused} size=${focusProxy.width}x${focusProxy.height}")
|
|
107
|
-
|
|
108
|
-
// Sync proxy ID with ControlledInputView's React Native tag BEFORE requestFocus(),
|
|
109
|
-
// so KeyboardAnimationCallback.focusListener sets viewTagFocused = this.id (not -1).
|
|
110
|
-
// Without this, KeyboardAwareScrollView JS sees e.target=-1 → focusWasChanged=false
|
|
111
|
-
// → layout.value never updated → maybeScroll() always returns 0 → no scroll.
|
|
112
|
-
focusProxy.id = this.id
|
|
113
|
-
Log.d(TAG, " proxy.id set to ${focusProxy.id} (= ControlledInputView RN tag)")
|
|
114
|
-
|
|
115
|
-
// Sync textSize so KeyboardControllerSelectionWatcher computes the correct
|
|
116
|
-
// cursor Y via android.text.Layout.getLineBottom() — used as `customHeight`
|
|
117
|
-
// in KeyboardAwareScrollView to determine how far to scroll.
|
|
118
|
-
fontSize?.let {
|
|
119
|
-
focusProxy.setTextSize(TypedValue.COMPLEX_UNIT_SP, it)
|
|
120
|
-
Log.d(TAG, " proxy textSize set to ${focusProxy.textSize}px (${it}sp)")
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
focusProxy.requestFocus()
|
|
124
|
-
Log.d(TAG, " proxy after requestFocus: isFocused=${focusProxy.isFocused} hasFocus=${focusProxy.hasFocus()}")
|
|
125
|
-
|
|
126
|
-
if (focusProxy.isFocused) {
|
|
127
|
-
// Proxy stole Android focus from AndroidComposeView → Compose will fire onBlur.
|
|
128
|
-
// Mark restoration mode so onBlur knows to recover (not dispatch BlurEvent to JS).
|
|
129
|
-
isRestoringComposeFocus = true
|
|
130
|
-
Log.d(TAG, " isRestoringComposeFocus=true (proxy has Android focus)")
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// setSelection triggers a selection change (lastSelectionStart starts at -1),
|
|
134
|
-
// guaranteeing the watcher fires on the next pre-draw frame even if focus
|
|
135
|
-
// was just transferred.
|
|
136
|
-
focusProxy.setSelection(0)
|
|
137
|
-
Log.d(TAG, " proxy selectionStart=${focusProxy.selectionStart} layout=${focusProxy.layout != null}")
|
|
138
|
-
|
|
139
|
-
// Log absolute screen position — this is what keyboard-controller reads for scroll calculation
|
|
140
|
-
val loc = IntArray(2)
|
|
141
|
-
focusProxy.getLocationOnScreen(loc)
|
|
142
|
-
Log.d(TAG, " proxy screenLocation x=${loc[0]} y=${loc[1]} → absoluteY for KBC=${loc[1]}px")
|
|
143
|
-
Log.d(TAG, "──────────────────────────")
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
private fun clearFocusProxy() {
|
|
147
|
-
Log.d(TAG, "clearFocusProxy: proxy.isFocused=${focusProxy.isFocused} hasFocus=${focusProxy.hasFocus()}")
|
|
148
|
-
focusProxy.clearFocus()
|
|
149
|
-
Log.d(TAG, "clearFocusProxy: after clearFocus isFocused=${focusProxy.isFocused}")
|
|
150
|
-
}
|
|
151
|
-
|
|
152
87
|
/**
|
|
153
|
-
*
|
|
154
|
-
* Compose). At this point KBC's listener has already cleared lastFocusedInput (KBC registered
|
|
155
|
-
* its ViewTreeObserver listener before us → it fires first). We post restoreKbcTracking() to
|
|
156
|
-
* run after all synchronous focus-change handlers complete.
|
|
157
|
-
*/
|
|
158
|
-
private val proxyFocusLostListener =
|
|
159
|
-
ViewTreeObserver.OnGlobalFocusChangeListener { oldFocus, newFocus ->
|
|
160
|
-
// Fire for ANY proxy focus loss while we're in the restoration dance.
|
|
161
|
-
// newFocus can be null (proxy→null→AndroidComposeView, two steps on first focus)
|
|
162
|
-
// or AndroidComposeView directly (proxy→AndroidComposeView, subsequent focuses).
|
|
163
|
-
// Both cases need restoreKbcTracking(); KBC's null→AndroidComposeView transition does
|
|
164
|
-
// NOT clear lastFocusedInput, so restoring it once is enough for both paths.
|
|
165
|
-
if (oldFocus == focusProxy && isRestoringComposeFocus) {
|
|
166
|
-
Log.d(
|
|
167
|
-
TAG,
|
|
168
|
-
"proxyFocusLostListener: proxy → ${newFocus?.javaClass?.simpleName ?: "null"}, posting restoreKbcTracking()",
|
|
169
|
-
)
|
|
170
|
-
post { restoreKbcTracking() }
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* EdgeToEdgeViewRegistry.get() → callback → FocusedInputObserver.
|
|
88
|
+
* EdgeToEdgeViewRegistry → KeyboardAnimationCallback + FocusedInputObserver.
|
|
176
89
|
* Null if react-native-keyboard-controller is missing or not initialized.
|
|
177
90
|
*/
|
|
178
|
-
private fun
|
|
91
|
+
private fun resolveKbcCallbackAndObserver(): Pair<Any, Any>? {
|
|
179
92
|
try {
|
|
180
93
|
val registryClass =
|
|
181
94
|
Class.forName("com.reactnativekeyboardcontroller.views.EdgeToEdgeViewRegistry")
|
|
@@ -183,7 +96,7 @@ class ControlledInputView : LinearLayout, LifecycleOwner {
|
|
|
183
96
|
val edgeToEdgeView =
|
|
184
97
|
registryClass.getDeclaredMethod("get").invoke(registryInstance)
|
|
185
98
|
?: run {
|
|
186
|
-
Log.w(TAG, "
|
|
99
|
+
Log.w(TAG, "resolveKbcCallbackAndObserver: EdgeToEdgeViewRegistry.get() == null")
|
|
187
100
|
return null
|
|
188
101
|
}
|
|
189
102
|
|
|
@@ -192,14 +105,14 @@ class ControlledInputView : LinearLayout, LifecycleOwner {
|
|
|
192
105
|
it.type.simpleName == "KeyboardAnimationCallback"
|
|
193
106
|
}
|
|
194
107
|
?: run {
|
|
195
|
-
Log.w(TAG, "
|
|
108
|
+
Log.w(TAG, "resolveKbcCallbackAndObserver: KeyboardAnimationCallback field not found")
|
|
196
109
|
return null
|
|
197
110
|
}
|
|
198
111
|
callbackField.isAccessible = true
|
|
199
112
|
val callback =
|
|
200
113
|
callbackField.get(edgeToEdgeView)
|
|
201
114
|
?: run {
|
|
202
|
-
Log.w(TAG, "
|
|
115
|
+
Log.w(TAG, "resolveKbcCallbackAndObserver: callback == null")
|
|
203
116
|
return null
|
|
204
117
|
}
|
|
205
118
|
|
|
@@ -208,35 +121,63 @@ class ControlledInputView : LinearLayout, LifecycleOwner {
|
|
|
208
121
|
it.type.simpleName == "FocusedInputObserver"
|
|
209
122
|
}
|
|
210
123
|
?: run {
|
|
211
|
-
Log.w(TAG, "
|
|
124
|
+
Log.w(TAG, "resolveKbcCallbackAndObserver: FocusedInputObserver field not found")
|
|
212
125
|
return null
|
|
213
126
|
}
|
|
214
127
|
observerField.isAccessible = true
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
128
|
+
val observer =
|
|
129
|
+
observerField.get(callback)
|
|
130
|
+
?: run {
|
|
131
|
+
Log.w(TAG, "resolveKbcCallbackAndObserver: layoutObserver == null")
|
|
132
|
+
return null
|
|
133
|
+
}
|
|
134
|
+
return Pair(callback, observer)
|
|
220
135
|
} catch (_: ClassNotFoundException) {
|
|
221
|
-
Log.d(TAG, "
|
|
136
|
+
Log.d(TAG, "resolveKbcCallbackAndObserver: keyboard-controller not on classpath")
|
|
222
137
|
return null
|
|
223
138
|
} catch (e: Exception) {
|
|
224
|
-
Log.w(TAG, "
|
|
139
|
+
Log.w(TAG, "resolveKbcCallbackAndObserver: ${e.javaClass.simpleName}: ${e.message}")
|
|
225
140
|
return null
|
|
226
141
|
}
|
|
227
142
|
}
|
|
228
143
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
144
|
+
private fun setKbcViewTagFocused(callback: Any) {
|
|
145
|
+
try {
|
|
146
|
+
val f = callback.javaClass.getDeclaredField("viewTagFocused")
|
|
147
|
+
f.isAccessible = true
|
|
148
|
+
f.setInt(callback, id)
|
|
149
|
+
Log.d(TAG, "setKbcViewTagFocused: viewTagFocused=$id")
|
|
150
|
+
} catch (e: Exception) {
|
|
151
|
+
Log.w(TAG, "setKbcViewTagFocused: ${e.javaClass.simpleName}: ${e.message}")
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
private fun setKbcFocusedInputHolder() {
|
|
156
|
+
try {
|
|
157
|
+
val holderClass =
|
|
158
|
+
Class.forName("com.reactnativekeyboardcontroller.traversal.FocusedInputHolder")
|
|
159
|
+
val instance = holderClass.getField("INSTANCE").get(null)
|
|
160
|
+
holderClass
|
|
161
|
+
.getMethod("set", EditText::class.java)
|
|
162
|
+
.invoke(instance, kbcLayoutHost)
|
|
163
|
+
} catch (e: Exception) {
|
|
164
|
+
Log.w(TAG, "setKbcFocusedInputHolder: ${e.javaClass.simpleName}: ${e.message}")
|
|
165
|
+
}
|
|
234
166
|
}
|
|
235
167
|
|
|
236
168
|
/**
|
|
237
|
-
*
|
|
238
|
-
*
|
|
169
|
+
* `selection.end.y` for KBC / JS customHeight: prefer explicit style height (dp, same as padding
|
|
170
|
+
* in [InputStyle]), else measured view height in dp.
|
|
239
171
|
*/
|
|
172
|
+
private fun approximateSelectionEndYDp(): Double {
|
|
173
|
+
viewModel.inputStyle.value?.height?.takeIf { it > 0 }?.let { return it }
|
|
174
|
+
val dm = resources.displayMetrics
|
|
175
|
+
if (height > 0) {
|
|
176
|
+
return (height / dm.density).toDouble()
|
|
177
|
+
}
|
|
178
|
+
return 12.0
|
|
179
|
+
}
|
|
180
|
+
|
|
240
181
|
private fun dispatchSyntheticKbcSelectionEvent(observer: Any) {
|
|
241
182
|
val reactContext = context as? ReactContext ?: return
|
|
242
183
|
try {
|
|
@@ -282,27 +223,34 @@ class ControlledInputView : LinearLayout, LifecycleOwner {
|
|
|
282
223
|
}
|
|
283
224
|
|
|
284
225
|
/**
|
|
285
|
-
*
|
|
286
|
-
*
|
|
226
|
+
* Pushes ControlledInput state into KBC without stealing Compose focus:
|
|
227
|
+
* viewTagFocused, lastFocusedInput, FocusedInputHolder, syncUpLayout, synthetic selection.
|
|
287
228
|
*/
|
|
288
|
-
private fun
|
|
289
|
-
Log.d(TAG, "
|
|
290
|
-
|
|
291
|
-
|
|
229
|
+
private fun syncKeyboardControllerFocusedInput() {
|
|
230
|
+
Log.d(TAG, "syncKeyboardControllerFocusedInput: id=$id")
|
|
231
|
+
kbcLayoutHost.id = id
|
|
232
|
+
viewModel.inputStyle.value?.fontSize?.toFloat()?.let {
|
|
233
|
+
kbcLayoutHost.setTextSize(TypedValue.COMPLEX_UNIT_SP, it)
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
val (callback, observer) = resolveKbcCallbackAndObserver() ?: return
|
|
237
|
+
|
|
238
|
+
setKbcViewTagFocused(callback)
|
|
239
|
+
setKbcFocusedInputHolder()
|
|
292
240
|
|
|
241
|
+
try {
|
|
293
242
|
val lastFocusedField = observer.javaClass.getDeclaredField("lastFocusedInput")
|
|
294
243
|
lastFocusedField.isAccessible = true
|
|
295
|
-
lastFocusedField.set(observer,
|
|
296
|
-
Log.d(TAG, "restoreKbcTracking: lastFocusedInput set to focusProxy")
|
|
244
|
+
lastFocusedField.set(observer, kbcLayoutHost)
|
|
297
245
|
|
|
298
246
|
val syncMethod = observer.javaClass.getDeclaredMethod("syncUpLayout")
|
|
299
247
|
syncMethod.isAccessible = true
|
|
300
248
|
syncMethod.invoke(observer)
|
|
301
|
-
Log.d(TAG, "
|
|
249
|
+
Log.d(TAG, "syncKeyboardControllerFocusedInput: syncUpLayout() ok")
|
|
302
250
|
|
|
303
251
|
dispatchSyntheticKbcSelectionEvent(observer)
|
|
304
252
|
} catch (e: Exception) {
|
|
305
|
-
Log.w(TAG, "
|
|
253
|
+
Log.w(TAG, "syncKeyboardControllerFocusedInput: ${e.javaClass.simpleName}: ${e.message}")
|
|
306
254
|
}
|
|
307
255
|
}
|
|
308
256
|
|
|
@@ -310,19 +258,15 @@ class ControlledInputView : LinearLayout, LifecycleOwner {
|
|
|
310
258
|
|
|
311
259
|
override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {
|
|
312
260
|
super.onLayout(changed, l, t, r, b)
|
|
313
|
-
|
|
314
|
-
// the correct width/height/absolutePosition when the proxy is focused.
|
|
315
|
-
focusProxy.layout(0, 0, width, height)
|
|
261
|
+
kbcLayoutHost.layout(0, 0, width, height)
|
|
316
262
|
if (changed) {
|
|
317
263
|
val loc = IntArray(2)
|
|
318
264
|
getLocationOnScreen(loc)
|
|
319
265
|
Log.d(TAG, "onLayout: view=${width}x${height} screenX=${loc[0]} screenY=${loc[1]}")
|
|
320
|
-
Log.d(TAG, "onLayout: proxy=${focusProxy.width}x${focusProxy.height} (should match view)")
|
|
321
266
|
}
|
|
322
267
|
}
|
|
323
268
|
|
|
324
269
|
override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) {
|
|
325
|
-
// Do not measure ComposeView until attached to a window.
|
|
326
270
|
if (shouldUseAndroidLayout && !isAttachedToWindow) {
|
|
327
271
|
setMeasuredDimension(
|
|
328
272
|
MeasureSpec.getSize(widthMeasureSpec).coerceAtLeast(0),
|
|
@@ -333,7 +277,6 @@ class ControlledInputView : LinearLayout, LifecycleOwner {
|
|
|
333
277
|
super.onMeasure(widthMeasureSpec, heightMeasureSpec)
|
|
334
278
|
}
|
|
335
279
|
|
|
336
|
-
// Fabric/Yoga often won't drive Android layout for native children.
|
|
337
280
|
override fun requestLayout() {
|
|
338
281
|
super.requestLayout()
|
|
339
282
|
if (shouldUseAndroidLayout) {
|
|
@@ -353,14 +296,11 @@ class ControlledInputView : LinearLayout, LifecycleOwner {
|
|
|
353
296
|
override fun onAttachedToWindow() {
|
|
354
297
|
super.onAttachedToWindow()
|
|
355
298
|
Log.d(TAG, "onAttachedToWindow: id=$id")
|
|
356
|
-
viewTreeObserver.addOnGlobalFocusChangeListener(proxyFocusLostListener)
|
|
357
299
|
bindComposeToWindowLifecycle()
|
|
358
300
|
}
|
|
359
301
|
|
|
360
302
|
override fun onDetachedFromWindow() {
|
|
361
303
|
Log.d(TAG, "onDetachedFromWindow: id=$id")
|
|
362
|
-
viewTreeObserver.removeOnGlobalFocusChangeListener(proxyFocusLostListener)
|
|
363
|
-
isRestoringComposeFocus = false
|
|
364
304
|
if (usesLocalFallbackLifecycle) {
|
|
365
305
|
lifecycleRegistry.currentState = Lifecycle.State.CREATED
|
|
366
306
|
}
|
|
@@ -406,12 +346,10 @@ class ControlledInputView : LinearLayout, LifecycleOwner {
|
|
|
406
346
|
|
|
407
347
|
fun blur() {
|
|
408
348
|
Log.d(TAG, "blur() called from JS ref")
|
|
409
|
-
isRestoringComposeFocus = false
|
|
410
349
|
blurSignal.value = blurSignal.value + 1
|
|
411
350
|
val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
|
|
412
351
|
imm.hideSoftInputFromWindow(windowToken, 0)
|
|
413
352
|
clearFocus()
|
|
414
|
-
clearFocusProxy()
|
|
415
353
|
}
|
|
416
354
|
|
|
417
355
|
fun focus() {
|
|
@@ -431,7 +369,7 @@ class ControlledInputView : LinearLayout, LifecycleOwner {
|
|
|
431
369
|
|
|
432
370
|
viewModel = JetpackComposeViewModel()
|
|
433
371
|
|
|
434
|
-
addView(
|
|
372
|
+
addView(kbcLayoutHost)
|
|
435
373
|
|
|
436
374
|
composeView = ComposeView(context).also { cv ->
|
|
437
375
|
cv.layoutParams = LayoutParams(
|
|
@@ -483,47 +421,21 @@ class ControlledInputView : LinearLayout, LifecycleOwner {
|
|
|
483
421
|
)
|
|
484
422
|
},
|
|
485
423
|
onFocus = {
|
|
486
|
-
Log.d(TAG, "Compose onFocus id=$id
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
isRestoringComposeFocus = false
|
|
494
|
-
} else {
|
|
495
|
-
val surfaceId = UIManagerHelper.getSurfaceId(context)
|
|
496
|
-
val viewId = this@ControlledInputView.id
|
|
497
|
-
UIManagerHelper
|
|
498
|
-
.getEventDispatcherForReactTag(context as ReactContext, viewId)
|
|
499
|
-
?.dispatchEvent(FocusEvent(surfaceId, viewId))
|
|
500
|
-
requestFocusProxy()
|
|
501
|
-
}
|
|
424
|
+
Log.d(TAG, "Compose onFocus id=$id")
|
|
425
|
+
val surfaceId = UIManagerHelper.getSurfaceId(context)
|
|
426
|
+
val viewId = this@ControlledInputView.id
|
|
427
|
+
UIManagerHelper
|
|
428
|
+
.getEventDispatcherForReactTag(context as ReactContext, viewId)
|
|
429
|
+
?.dispatchEvent(FocusEvent(surfaceId, viewId))
|
|
430
|
+
post { syncKeyboardControllerFocusedInput() }
|
|
502
431
|
},
|
|
503
432
|
onBlur = {
|
|
504
|
-
Log.d(TAG, "Compose onBlur id=$id
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
post {
|
|
511
|
-
// Give AndroidComposeView Android focus back (needed for showSoftInput to work)
|
|
512
|
-
composeView.requestFocus()
|
|
513
|
-
// Trigger BasicTextField to re-gain Compose focus → shows keyboard → fires onFocus
|
|
514
|
-
focusSignal.value = focusSignal.value + 1
|
|
515
|
-
}
|
|
516
|
-
} else {
|
|
517
|
-
// Real blur (user dismissed keyboard / tapped elsewhere)
|
|
518
|
-
Log.d(TAG, " → real blur: dispatching BlurEvent")
|
|
519
|
-
isRestoringComposeFocus = false
|
|
520
|
-
val surfaceId = UIManagerHelper.getSurfaceId(context)
|
|
521
|
-
val viewId = this@ControlledInputView.id
|
|
522
|
-
UIManagerHelper
|
|
523
|
-
.getEventDispatcherForReactTag(context as ReactContext, viewId)
|
|
524
|
-
?.dispatchEvent(BlurEvent(surfaceId, viewId))
|
|
525
|
-
clearFocusProxy()
|
|
526
|
-
}
|
|
433
|
+
Log.d(TAG, "Compose onBlur id=$id")
|
|
434
|
+
val surfaceId = UIManagerHelper.getSurfaceId(context)
|
|
435
|
+
val viewId = this@ControlledInputView.id
|
|
436
|
+
UIManagerHelper
|
|
437
|
+
.getEventDispatcherForReactTag(context as ReactContext, viewId)
|
|
438
|
+
?.dispatchEvent(BlurEvent(surfaceId, viewId))
|
|
527
439
|
},
|
|
528
440
|
focusRequester = focusRequester
|
|
529
441
|
)
|
|
@@ -81,6 +81,7 @@ class ControlledInputViewManager : SimpleViewManager<ControlledInputView>(),
|
|
|
81
81
|
InputStyle(
|
|
82
82
|
color = if (inputStyle.hasKey("color")) inputStyle.getString("color") else null,
|
|
83
83
|
fontSize = if (inputStyle.hasKey("fontSize")) inputStyle.getDouble("fontSize") else null,
|
|
84
|
+
height = if (inputStyle.hasKey("height")) inputStyle.getDouble("height") else null,
|
|
84
85
|
fontFamily = if (inputStyle.hasKey("fontFamily")) inputStyle.getString("fontFamily") else null,
|
|
85
86
|
paddingTop = if (inputStyle.hasKey("paddingTop")) inputStyle.getDouble("paddingTop") else null,
|
|
86
87
|
paddingBottom = if (inputStyle.hasKey("paddingBottom")) inputStyle.getDouble("paddingBottom") else null,
|
|
@@ -51,6 +51,7 @@ import kotlinx.coroutines.flow.StateFlow
|
|
|
51
51
|
data class InputStyle(
|
|
52
52
|
val color: String? = null,
|
|
53
53
|
val fontSize: Double? = null,
|
|
54
|
+
val height: Double? = null,
|
|
54
55
|
val fontFamily: String? = null,
|
|
55
56
|
val paddingTop: Double? = null,
|
|
56
57
|
val paddingBottom: Double? = null,
|
|
@@ -25,6 +25,8 @@ export interface BlurEvent {
|
|
|
25
25
|
export interface InputStyle {
|
|
26
26
|
color?: ColorValue;
|
|
27
27
|
fontSize?: Double;
|
|
28
|
+
/** Matches style.height (dp); used for keyboard-controller customHeight on Android. */
|
|
29
|
+
height?: Double;
|
|
28
30
|
fontFamily?: string;
|
|
29
31
|
paddingTop?: Double;
|
|
30
32
|
paddingBottom?: Double;
|
package/lib/module/index.js
CHANGED
|
@@ -52,6 +52,9 @@ export const ControlledInputView = /*#__PURE__*/memo(/*#__PURE__*/forwardRef(({
|
|
|
52
52
|
inputStyle = {
|
|
53
53
|
color: flattenedStyle.color,
|
|
54
54
|
fontSize: flattenedStyle.fontSize,
|
|
55
|
+
...(typeof flattenedStyle.height === 'number' ? {
|
|
56
|
+
height: flattenedStyle.height
|
|
57
|
+
} : {}),
|
|
55
58
|
fontFamily: flattenedStyle.fontFamily,
|
|
56
59
|
...(hasPadding ? resolveAndroidComposeViewPadding(flattenedStyle) : {}),
|
|
57
60
|
borderWidth: flattenedStyle.borderWidth,
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["forwardRef","memo","useImperativeHandle","useLayoutEffect","useRef","Platform","processColor","StyleSheet","TextInputState","ControlledInputViewNativeComponent","jsx","_jsx","androidComposeHandledKeys","resolveAndroidComposeViewPadding","flat","padding","paddingTop","paddingVertical","paddingBottom","paddingLeft","paddingHorizontal","paddingRight","ControlledInputView","style","onTextChange","onFocus","onBlur","selectionColor","placeholderTextColor","rest","ref","nativeRef","isNativePlatform","OS","node","current","registerInput","unregisterInput","currentlyFocusedInput","blurTextInput","flattenedStyle","flatten","viewStyle","inputStyle","Object","fromEntries","entries","filter","k","includes","hasPadding","some","v","color","fontSize","fontFamily","borderWidth","borderRadius","borderColor","backgroundColor","iosViewStyle","hasTextStyle","undefined","handleTextChange","e","nativeEvent","value","handleFocus","focusInput","handleBlur","blurInput","blur","focus","focusTextInput","displayName"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SACEA,UAAU,EACVC,IAAI,EACJC,mBAAmB,EACnBC,eAAe,EACfC,MAAM,QAED,OAAO;AACd,SACEC,QAAQ,EACRC,YAAY,EACZC,UAAU,QAIL,cAAc;AACrB,OAAOC,cAAc,MAAM,4DAA4D;AACvF,OAAOC,kCAAkC,MAGlC,sCAAsC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAiC9C;AACA,MAAMC,yBAAyB,GAAG,CAChC,OAAO,EACP,UAAU,EACV,YAAY,EACZ,SAAS,EACT,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,eAAe,EACf,aAAa,EACb,cAAc,EACd,aAAa,EACb,cAAc,EACd,aAAa,EACb,iBAAiB,CAClB;AAED,SAASC,gCAAgCA,CAACC,IAAyB,EAKjE;EACA,MAAMC,OAAO,GAAGD,IAAI,CAACC,OAAO,IAAI,CAAC;EAEjC,OAAO;IACLC,UAAU,EAAEF,IAAI,CAACE,UAAU,IAAIF,IAAI,CAACG,eAAe,IAAIF,OAAO;IAC9DG,aAAa,EAAEJ,IAAI,CAACI,aAAa,IAAIJ,IAAI,CAACG,eAAe,IAAIF,OAAO;IACpEI,WAAW,EAAEL,IAAI,CAACK,WAAW,IAAIL,IAAI,CAACM,iBAAiB,IAAIL,OAAO;IAClEM,YAAY,EAAEP,IAAI,CAACO,YAAY,I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AU,GAAGN,MAAM,CAACE,OAAO,CAACN,cAAc,CAAC,CAACW,IAAI,CACpD,CAAC,CAACH,CAAC,EAAEI,CAAC,CAAC,KAAKJ,CAAC,CAACC,QAAQ,CAAC,SAAS,CAAC,IAAIG,CAAC,IAAI,IAC5C,CAAC;IAEDT,UAAU,GAAG;MACXU,KAAK,EAAEb,cAAc,CAACa,KAAK;MAC3BC,QAAQ,EAAEd,cAAc,CAACc,QAAQ;
|
|
1
|
+
{"version":3,"names":["forwardRef","memo","useImperativeHandle","useLayoutEffect","useRef","Platform","processColor","StyleSheet","TextInputState","ControlledInputViewNativeComponent","jsx","_jsx","androidComposeHandledKeys","resolveAndroidComposeViewPadding","flat","padding","paddingTop","paddingVertical","paddingBottom","paddingLeft","paddingHorizontal","paddingRight","ControlledInputView","style","onTextChange","onFocus","onBlur","selectionColor","placeholderTextColor","rest","ref","nativeRef","isNativePlatform","OS","node","current","registerInput","unregisterInput","currentlyFocusedInput","blurTextInput","flattenedStyle","flatten","viewStyle","inputStyle","Object","fromEntries","entries","filter","k","includes","hasPadding","some","v","color","fontSize","height","fontFamily","borderWidth","borderRadius","borderColor","backgroundColor","iosViewStyle","hasTextStyle","undefined","handleTextChange","e","nativeEvent","value","handleFocus","focusInput","handleBlur","blurInput","blur","focus","focusTextInput","displayName"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SACEA,UAAU,EACVC,IAAI,EACJC,mBAAmB,EACnBC,eAAe,EACfC,MAAM,QAED,OAAO;AACd,SACEC,QAAQ,EACRC,YAAY,EACZC,UAAU,QAIL,cAAc;AACrB,OAAOC,cAAc,MAAM,4DAA4D;AACvF,OAAOC,kCAAkC,MAGlC,sCAAsC;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAiC9C;AACA,MAAMC,yBAAyB,GAAG,CAChC,OAAO,EACP,UAAU,EACV,YAAY,EACZ,SAAS,EACT,iBAAiB,EACjB,mBAAmB,EACnB,YAAY,EACZ,eAAe,EACf,aAAa,EAC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;IAAA,GAC7BoB,IAAI;IACRD,oBAAoB,EAAEA,oBAAqB;IAC3CD,cAAc,EAAEA,cAAe;IAC/BJ,KAAK,EAAEmB,SAAU;IACjBC,UAAU,EAAEA,UAAW;IACvBnB,YAAY,EAAEwC,gBAAiB;IAC/BvC,OAAO,EAAE2C,WAAY;IACrB1C,MAAM,EAAE4C,UAAW;IACnBxC,GAAG,EAAEC;EAAU,CAChB,CAAC;AAEN,CACF,CACF,CAAC;AAEDT,mBAAmB,CAACqD,WAAW,GAAG,qBAAqB;AAEvD,cAAc,sCAAsC","ignoreList":[]}
|
|
@@ -10,6 +10,8 @@ export interface BlurEvent {
|
|
|
10
10
|
export interface InputStyle {
|
|
11
11
|
color?: ColorValue;
|
|
12
12
|
fontSize?: Double;
|
|
13
|
+
/** Matches style.height (dp); used for keyboard-controller customHeight on Android. */
|
|
14
|
+
height?: Double;
|
|
13
15
|
fontFamily?: string;
|
|
14
16
|
paddingTop?: Double;
|
|
15
17
|
paddingBottom?: Double;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ControlledInputViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/ControlledInputViewNativeComponent.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAEtB,OAAO,KAAK,EACV,oBAAoB,EACpB,MAAM,EACP,MAAM,2CAA2C,CAAC;AAEnD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,UAAU;CAE1B;AAED,MAAM,WAAW,SAAS;CAEzB;AAED,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAA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AAoB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;IACrD,MAAM,CAAC,EAAE,oBAAoB,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;CACpD;AAED,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,KAAK,IAAI,CAAC;IACvE,IAAI,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,KAAK,IAAI,CAAC;CACvE;AAED,eAAO,MAAM,QAAQ,EAAE,cAErB,CAAC;;AAEH,wBAA0E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAQA,OAAO,EAIL,KAAK,cAAc,EAGpB,MAAM,cAAc,CAAC;AAEtB,OAA2C,EACzC,KAAK,WAAW,EAEjB,MAAM,sCAAsC,CAAC;AAE9C,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,KAAK,uBAAuB,GAAG,IAAI,CACjC,cAAc,EACZ,cAAc,GACd,gBAAgB,GAChB,cAAc,GACd,eAAe,GACf,aAAa,GACb,sBAAsB,GACtB,gBAAgB,CACnB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,WAAW,EACX,YAAY,GAAG,cAAc,GAAG,MAAM,uBAAuB,CAC9D,GACC,uBAAuB,GAAG;IACxB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC,CAAC;AA2CJ,eAAO,MAAM,mBAAmB;mBA5Cb,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAQA,OAAO,EAIL,KAAK,cAAc,EAGpB,MAAM,cAAc,CAAC;AAEtB,OAA2C,EACzC,KAAK,WAAW,EAEjB,MAAM,sCAAsC,CAAC;AAE9C,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB;AAED,KAAK,uBAAuB,GAAG,IAAI,CACjC,cAAc,EACZ,cAAc,GACd,gBAAgB,GAChB,cAAc,GACd,eAAe,GACf,aAAa,GACb,sBAAsB,GACtB,gBAAgB,CACnB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,IAAI,CACzC,WAAW,EACX,YAAY,GAAG,cAAc,GAAG,MAAM,uBAAuB,CAC9D,GACC,uBAAuB,GAAG;IACxB,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC,CAAC;AA2CJ,eAAO,MAAM,mBAAmB;mBA5Cb,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI;0DAoLzC,CAAC;AAIF,cAAc,sCAAsC,CAAC"}
|
package/package.json
CHANGED
|
@@ -25,6 +25,8 @@ export interface BlurEvent {
|
|
|
25
25
|
export interface InputStyle {
|
|
26
26
|
color?: ColorValue;
|
|
27
27
|
fontSize?: Double;
|
|
28
|
+
/** Matches style.height (dp); used for keyboard-controller customHeight on Android. */
|
|
29
|
+
height?: Double;
|
|
28
30
|
fontFamily?: string;
|
|
29
31
|
paddingTop?: Double;
|
|
30
32
|
paddingBottom?: Double;
|
package/src/index.tsx
CHANGED
|
@@ -146,6 +146,9 @@ export const ControlledInputView = memo(
|
|
|
146
146
|
inputStyle = {
|
|
147
147
|
color: flattenedStyle.color,
|
|
148
148
|
fontSize: flattenedStyle.fontSize,
|
|
149
|
+
...(typeof flattenedStyle.height === 'number'
|
|
150
|
+
? { height: flattenedStyle.height }
|
|
151
|
+
: {}),
|
|
149
152
|
fontFamily: flattenedStyle.fontFamily,
|
|
150
153
|
...(hasPadding
|
|
151
154
|
? resolveAndroidComposeViewPadding(flattenedStyle)
|