react-native-controlled-input 0.12.4 → 0.13.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.
@@ -26,6 +26,10 @@ import com.facebook.react.uimanager.UIManagerHelper
26
26
  import kotlinx.coroutines.flow.MutableStateFlow
27
27
 
28
28
  /**
29
+ * Keep this class in package `com.controlledinput` with simple name `ControlledInputView`:
30
+ * apps that patch `react-native-keyboard-controller` locate the host via
31
+ * `Class.name == "com.controlledinput.ControlledInputView"` for Compose (non-EditText) focus.
32
+ *
29
33
  * RN + Jetpack Compose hosting view aligned with Expo UI / [ExpoComposeView] + [ExpoView]:
30
34
  * - [shouldUseAndroidLayout]: requestLayout posts measureAndLayout (RN #17968)
31
35
  * - onMeasure skips child [ComposeView] until attached (window + WindowRecomposer)
@@ -28,6 +28,15 @@ using namespace facebook::react;
28
28
  return concreteComponentDescriptorProvider<ControlledInputViewComponentDescriptor>();
29
29
  }
30
30
 
31
+ /// `react-native-keyboard-controller` resolves `UIResponder.reactViewTag` as
32
+ /// `(firstResponder as UIView).superview.tag`. The field's superview is this content view,
33
+ /// so its `tag` must match the Fabric component's react tag or keyboard events disagree
34
+ /// on `target` and `KeyboardAwareScrollView` mis-animates (iOS hide jumps).
35
+ - (void)syncContentViewReactTagFromContainer
36
+ {
37
+ _inputView.tag = self.tag;
38
+ }
39
+
31
40
  - (instancetype)initWithFrame:(CGRect)frame
32
41
  {
33
42
  if (self = [super initWithFrame:frame]) {
@@ -38,11 +47,18 @@ using namespace facebook::react;
38
47
  _inputView.delegate = self;
39
48
 
40
49
  self.contentView = _inputView;
50
+ [self syncContentViewReactTagFromContainer];
41
51
  }
42
52
 
43
53
  return self;
44
54
  }
45
55
 
56
+ - (void)layoutSubviews
57
+ {
58
+ [super layoutSubviews];
59
+ [self syncContentViewReactTagFromContainer];
60
+ }
61
+
46
62
  - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
47
63
  {
48
64
  const auto &oldViewProps = *std::static_pointer_cast<ControlledInputViewProps const>(_props);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-controlled-input",
3
- "version": "0.12.4",
3
+ "version": "0.13.0",
4
4
  "description": "React Native Controlled Inputative Controlled Input",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",