Skip to content

Commit

Permalink
MM-54535 Fixed hang when using the magic keyboard on iPadOS 17 (#7555) (
Browse files Browse the repository at this point in the history
  • Loading branch information
mattermost-build authored Sep 28, 2023
1 parent 3383653 commit ab4d878
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 17 deletions.
2 changes: 1 addition & 1 deletion .github/actions/prepare-node-deps/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ runs:
- name: ci/setup-node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0
with:
node-version: "${{ env.NODE_VERSION }}"
node-version-file: ".nvmrc"
cache: "npm"
cache-dependency-path: package-lock.json

Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.7.0
18.17
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
save-exact=true
engine-strict=true
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.7.0
18.17
14 changes: 0 additions & 14 deletions .solidarity
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,6 @@
"output" : "moderate"
},
"requirements": {
"Node": [
{
"rule": "cli",
"binary": "node",
"semver": ">=16.0.0",
"error": "install node using nvm https://github.com/nvm-sh/nvm#installing-and-updating"
},
{
"rule": "cli",
"binary": "npm",
"semver": ">=7.24.0 <9.0.0",
"error": "install npm 8.5.5 `npm i -g [email protected]"
}
],
"Android": [
{
"rule": "cli",
Expand Down
4 changes: 4 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
"author": "Mattermost, Inc.",
"license": "Apache 2.0",
"private": true,
"engines": {
"node": "^18.10.0",
"npm": "^9.0.0"
},
"dependencies": {
"@formatjs/intl-datetimeformat": "6.10.0",
"@formatjs/intl-getcanonicallocales": "2.2.1",
Expand Down
37 changes: 37 additions & 0 deletions patches/react-native-keyboard-tracking-view+5.7.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,43 @@ index 1333a10..b908006 100644
RCT_EXPORT_METHOD(getNativeProps:(nonnull NSNumber *)reactTag resolver:(RCTPromiseResolveBlock)resolve rejecter:(RCTPromiseRejectBlock)reject)
{
[self.bridge.uiManager addUIBlock:
diff --git a/node_modules/react-native-keyboard-tracking-view/lib/ObservingInputAccessoryView.m b/node_modules/react-native-keyboard-tracking-view/lib/ObservingInputAccessoryView.m
index e472679..4a2204b 100644
--- a/node_modules/react-native-keyboard-tracking-view/lib/ObservingInputAccessoryView.m
+++ b/node_modules/react-native-keyboard-tracking-view/lib/ObservingInputAccessoryView.m
@@ -115,21 +115,25 @@

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

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

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

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

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

- (void)_keyboardWillHideNotification:(NSNotification*)notification
diff --git a/node_modules/react-native-keyboard-tracking-view/src/KeyboardTrackingView.android.js b/node_modules/react-native-keyboard-tracking-view/src/KeyboardTrackingView.android.js
index af15edf..20b6ab6 100644
--- a/node_modules/react-native-keyboard-tracking-view/src/KeyboardTrackingView.android.js
Expand Down

0 comments on commit ab4d878

Please sign in to comment.