Skip to content

Commit 17ac11a

Browse files
authored
Merge pull request Expensify#65804 from linhvovan29546/fix/64900-expand-button-not-appear
2 parents 41c675b + 21549ec commit 17ac11a

2 files changed

Lines changed: 45 additions & 0 deletions

File tree

patches/react-native/details.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,10 @@
176176
- Upstream PR/issue: https://github.com/facebook/react-native/pull/52530
177177
- E/App issue: https://github.com/Expensify/App/issues/65268
178178
- PR introducing patch: [#65925](https://github.com/Expensify/App/pull/65925)
179+
180+
### [react-native+0.79.2+025+fix-textinput-oncontentsizechange-dispatched-only-once-ios.patch](react-native+0.79.2+025+fix-textinput-oncontentsizechange-dispatched-only-once-ios.patch)
181+
182+
- Reason: This patch updates RCTTextInputComponentView.mm to fix an issue where the TextInput onContentSizeChange event is dispatched only once on iOS instead of being triggered for subsequent content size changes.
183+
- Upstream PR/issue: https://github.com/facebook/react-native/pull/50782
184+
- E/App issue: https://github.com/Expensify/App/issues/64900
185+
- PR introducing patch: [#65804](https://github.com/Expensify/App/pull/65804)
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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

Comments
 (0)