|
| 1 | +diff --git a/node_modules/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm b/node_modules/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm |
| 2 | +index fef9c63..1859b31 100644 |
| 3 | +--- a/node_modules/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm |
| 4 | ++++ b/node_modules/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm |
| 5 | +@@ -70,6 +70,7 @@ @implementation RCTTextInputComponentView { |
| 6 | + NSDictionary<NSAttributedStringKey, id> *_originalTypingAttributes; |
| 7 | + |
| 8 | + BOOL _hasInputAccessoryView; |
| 9 | ++ CGSize _previousContentSize; |
| 10 | + } |
| 11 | + |
| 12 | + #pragma mark - UIView overrides |
| 13 | +@@ -86,6 +87,7 @@ - (instancetype)initWithFrame:(CGRect)frame |
| 14 | + _comingFromJS = NO; |
| 15 | + _didMoveToWindow = NO; |
| 16 | + _originalTypingAttributes = [_backedTextInputView.typingAttributes copy]; |
| 17 | ++ _previousContentSize = CGSizeZero; |
| 18 | + |
| 19 | + [self addSubview:_backedTextInputView]; |
| 20 | + [self initializeReturnKeyType]; |
| 21 | +@@ -326,7 +328,6 @@ - (void)updateState:(const State::Shared &)state oldState:(const State::Shared & |
| 22 | + - (void)updateLayoutMetrics:(const LayoutMetrics &)layoutMetrics |
| 23 | + oldLayoutMetrics:(const LayoutMetrics &)oldLayoutMetrics |
| 24 | + { |
| 25 | +- CGSize previousContentSize = _backedTextInputView.contentSize; |
| 26 | + |
| 27 | + [super updateLayoutMetrics:layoutMetrics oldLayoutMetrics:oldLayoutMetrics]; |
| 28 | + |
| 29 | +@@ -335,7 +336,8 @@ - (void)updateLayoutMetrics:(const LayoutMetrics &)layoutMetrics |
| 30 | + _backedTextInputView.textContainerInset = |
| 31 | + RCTUIEdgeInsetsFromEdgeInsets(layoutMetrics.contentInsets - layoutMetrics.borderWidth); |
| 32 | + |
| 33 | +- if (!CGSizeEqualToSize(previousContentSize, _backedTextInputView.contentSize) && _eventEmitter) { |
| 34 | ++ if (!CGSizeEqualToSize(_previousContentSize, _backedTextInputView.contentSize) && _eventEmitter) { |
| 35 | ++ _previousContentSize = _backedTextInputView.contentSize; |
| 36 | + static_cast<const TextInputEventEmitter &>(*_eventEmitter).onContentSizeChange([self _textInputMetrics]); |
| 37 | + } |
| 38 | + } |
0 commit comments