Skip to content

Commit

Permalink
fix(iOS): Keyboard not working properly on iOS 17 (#5343)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolmello committed Nov 22, 2023
1 parent af8233d commit 1d568c9
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"react-native-slowlog": "^1.0.2",
"react-native-svg": "^13.8.0",
"react-native-ui-lib": "RocketChat/react-native-ui-lib#ef50151b8d9c1627ef527c620a1472868f9f4df8",
"react-native-url-polyfill": "^2.0.0",
"react-native-url-polyfill": "2.0.0",
"react-native-vector-icons": "9.1.0",
"react-native-webview": "11.26.1",
"react-redux": "^8.0.5",
Expand Down
37 changes: 37 additions & 0 deletions patches/react-native-ui-lib+7.0.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
diff --git a/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardtrackingview/ObservingInputAccessoryViewTemp.m b/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardtrackingview/ObservingInputAccessoryViewTemp.m
index 1ca52e8..323a04c 100644
--- a/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardtrackingview/ObservingInputAccessoryViewTemp.m
+++ b/node_modules/react-native-ui-lib/lib/ios/reactnativeuilib/keyboardtrackingview/ObservingInputAccessoryViewTemp.m
@@ -115,21 +115,25 @@ - (void)setHeight:(CGFloat)height

- (void)_keyboardWillShowNotification:(NSNotification*)notification
{
- _keyboardState = KeyboardStateWillShow;
+ if (_keyboardState != KeyboardStateShown) {
+ _keyboardState = KeyboardStateWillShow;

- [self invalidateIntrinsicContentSize];
+ [self invalidateIntrinsicContentSize];

- if([_delegate respondsToSelector:@selector(ObservingInputAccessoryViewTempKeyboardWillAppear:keyboardDelta:)])
- {
- [_delegate ObservingInputAccessoryViewTempKeyboardWillAppear:self keyboardDelta:_keyboardHeight - _previousKeyboardHeight];
+ if([_delegate respondsToSelector:@selector(ObservingInputAccessoryViewTempKeyboardWillAppear:keyboardDelta:)])
+ {
+ [_delegate ObservingInputAccessoryViewTempKeyboardWillAppear:self keyboardDelta:_keyboardHeight - _previousKeyboardHeight];
+ }
}
}

- (void)_keyboardDidShowNotification:(NSNotification*)notification
{
- _keyboardState = KeyboardStateShown;
+ if (_keyboardState != KeyboardStateShown) {
+ _keyboardState = KeyboardStateShown;

- [self invalidateIntrinsicContentSize];
+ [self invalidateIntrinsicContentSize];
+ }
}

- (void)_keyboardWillHideNotification:(NSNotification*)notification
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -17955,7 +17955,7 @@ react-native-ui-lib@RocketChat/react-native-ui-lib#ef50151b8d9c1627ef527c620a147
tinycolor2 "^1.4.2"
url-parse "^1.2.0"

react-native-url-polyfill@^2.0.0:
react-native-url-polyfill@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/react-native-url-polyfill/-/react-native-url-polyfill-2.0.0.tgz#db714520a2985cff1d50ab2e66279b9f91ffd589"
integrity sha512-My330Do7/DvKnEvwQc0WdcBnFPploYKp9CYlefDXzIdEaA+PAhDYllkvGeEroEzvc4Kzzj2O4yVdz8v6fjRvhA==
Expand Down

0 comments on commit 1d568c9

Please sign in to comment.