From f3bbd01c724e5778a3a1e379c5e5bf33de6d3798 Mon Sep 17 00:00:00 2001 From: kirillzyusko Date: Thu, 8 Aug 2024 18:54:23 +0200 Subject: [PATCH 1/4] fix: use `KeyboardAvoidingView` from `react-native-keyboard-controller` --- package-lock.json | 9 +++-- package.json | 2 +- ...t-native-keyboard-controller+1.12.7.patch} | 36 ++++++++++++------- .../KeyboardAvoidingView/index.ios.tsx | 2 +- 4 files changed, 30 insertions(+), 19 deletions(-) rename patches/{react-native-keyboard-controller+1.12.2.patch => react-native-keyboard-controller+1.12.7.patch} (56%) diff --git a/package-lock.json b/package-lock.json index 960f5eed7f8d..6d36a205d660 100644 --- a/package-lock.json +++ b/package-lock.json @@ -97,7 +97,7 @@ "react-native-image-picker": "^7.0.3", "react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#bf3ad41a61c4f6f80ed4d497599ef5247a2dd002", "react-native-key-command": "^1.0.8", - "react-native-keyboard-controller": "^1.12.2", + "react-native-keyboard-controller": "https://github.com/kirillzyusko/react-native-keyboard-controller.git#cfc62b7", "react-native-launch-arguments": "^4.0.2", "react-native-linear-gradient": "^2.8.1", "react-native-localize": "^2.2.6", @@ -37289,13 +37289,12 @@ "license": "MIT" }, "node_modules/react-native-keyboard-controller": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/react-native-keyboard-controller/-/react-native-keyboard-controller-1.12.2.tgz", - "integrity": "sha512-10Sy0+neSHGJxOmOxrUJR8TQznnrQ+jTFQtM1PP6YnblNQeAw1eOa+lO6YLGenRr5WuNSMZbks/3Ay0e2yMKLw==", + "version": "1.12.7", + "resolved": "git+ssh://git@github.com/kirillzyusko/react-native-keyboard-controller.git#cfc62b748af943eacbaffb77fe44873638fbbb07", "peerDependencies": { "react": "*", "react-native": "*", - "react-native-reanimated": ">=2.3.0" + "react-native-reanimated": ">=2.11.0" } }, "node_modules/react-native-launch-arguments": { diff --git a/package.json b/package.json index f91731ecf4da..5fdbb7e6e7fc 100644 --- a/package.json +++ b/package.json @@ -155,7 +155,7 @@ "react-native-image-picker": "^7.0.3", "react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#bf3ad41a61c4f6f80ed4d497599ef5247a2dd002", "react-native-key-command": "^1.0.8", - "react-native-keyboard-controller": "^1.12.2", + "react-native-keyboard-controller": "https://github.com/kirillzyusko/react-native-keyboard-controller.git#cfc62b7", "react-native-launch-arguments": "^4.0.2", "react-native-linear-gradient": "^2.8.1", "react-native-localize": "^2.2.6", diff --git a/patches/react-native-keyboard-controller+1.12.2.patch b/patches/react-native-keyboard-controller+1.12.7.patch similarity index 56% rename from patches/react-native-keyboard-controller+1.12.2.patch rename to patches/react-native-keyboard-controller+1.12.7.patch index 3c8034354481..1840e0c84b47 100644 --- a/patches/react-native-keyboard-controller+1.12.2.patch +++ b/patches/react-native-keyboard-controller+1.12.7.patch @@ -1,8 +1,8 @@ diff --git a/node_modules/react-native-keyboard-controller/android/src/main/java/com/reactnativekeyboardcontroller/views/EdgeToEdgeReactViewGroup.kt b/node_modules/react-native-keyboard-controller/android/src/main/java/com/reactnativekeyboardcontroller/views/EdgeToEdgeReactViewGroup.kt -index 83884d8..5d9e989 100644 +index 6e566fc..82416a1 100644 --- a/node_modules/react-native-keyboard-controller/android/src/main/java/com/reactnativekeyboardcontroller/views/EdgeToEdgeReactViewGroup.kt +++ b/node_modules/react-native-keyboard-controller/android/src/main/java/com/reactnativekeyboardcontroller/views/EdgeToEdgeReactViewGroup.kt -@@ -99,12 +99,12 @@ class EdgeToEdgeReactViewGroup(private val reactContext: ThemedReactContext) : R +@@ -117,11 +117,11 @@ class EdgeToEdgeReactViewGroup(private val reactContext: ThemedReactContext) : R } private fun goToEdgeToEdge(edgeToEdge: Boolean) { @@ -11,23 +11,23 @@ index 83884d8..5d9e989 100644 - it.window, - !edgeToEdge, - ) -- } -+ // reactContext.currentActivity?.let { -+ // WindowCompat.setDecorFitsSystemWindows( -+ // it.window, -+ // !edgeToEdge, -+ // ) -+ // } ++ // reactContext.currentActivity?.let { ++ // WindowCompat.setDecorFitsSystemWindows( ++ // it.window, ++ // !edgeToEdge, ++ // ) + } } - private fun setupKeyboardCallbacks() { -@@ -158,13 +158,13 @@ class EdgeToEdgeReactViewGroup(private val reactContext: ThemedReactContext) : R +@@ -169,16 +169,16 @@ class EdgeToEdgeReactViewGroup(private val reactContext: ThemedReactContext) : R // region State managers private fun enable() { this.goToEdgeToEdge(true) - this.setupWindowInsets() + // this.setupWindowInsets() this.setupKeyboardCallbacks() +- modalAttachedWatcher.enable() ++ // modalAttachedWatcher.enable() } private fun disable() { @@ -35,5 +35,17 @@ index 83884d8..5d9e989 100644 - this.setupWindowInsets() + // this.setupWindowInsets() this.removeKeyboardCallbacks() +- modalAttachedWatcher.disable() ++ // modalAttachedWatcher.disable() + } + // endregion + +@@ -206,7 +206,7 @@ class EdgeToEdgeReactViewGroup(private val reactContext: ThemedReactContext) : R + fun forceStatusBarTranslucent(isStatusBarTranslucent: Boolean) { + if (active && this.isStatusBarTranslucent != isStatusBarTranslucent) { + this.isStatusBarTranslucent = isStatusBarTranslucent +- this.setupWindowInsets() ++ // this.setupWindowInsets() + this.requestApplyInsetsWhenAttached() + } } - // endregion \ No newline at end of file diff --git a/src/components/KeyboardAvoidingView/index.ios.tsx b/src/components/KeyboardAvoidingView/index.ios.tsx index 171210eab7ac..68cfa73e90b5 100644 --- a/src/components/KeyboardAvoidingView/index.ios.tsx +++ b/src/components/KeyboardAvoidingView/index.ios.tsx @@ -2,7 +2,7 @@ * The KeyboardAvoidingView is only used on ios */ import React from 'react'; -import {KeyboardAvoidingView as KeyboardAvoidingViewComponent} from 'react-native'; +import {KeyboardAvoidingView as KeyboardAvoidingViewComponent} from 'react-native-keyboard-controller'; import type {KeyboardAvoidingViewProps} from './types'; function KeyboardAvoidingView(props: KeyboardAvoidingViewProps) { From 28efb6c381b6344af1a3cf3e00ad55f4cc2bdcec Mon Sep 17 00:00:00 2001 From: kirillzyusko Date: Thu, 8 Aug 2024 19:42:56 +0200 Subject: [PATCH 2/4] fix: synchronize Podfile.lock --- ios/Podfile.lock | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 4776096973bc..971764329c48 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1243,13 +1243,7 @@ PODS: - react-native-config (1.5.0): - react-native-config/App (= 1.5.0) - react-native-config/App (1.5.0): - - RCT-Folly - - RCTRequired - - RCTTypeSafety - - React - - React-Codegen - - React-RCTFabric - - ReactCommon/turbomodule/core + - React-Core - react-native-document-picker (9.1.1): - RCT-Folly - RCTRequired @@ -1303,7 +1297,7 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - react-native-keyboard-controller (1.12.2): + - react-native-keyboard-controller (1.12.7): - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) @@ -2565,7 +2559,7 @@ SPEC CHECKSUMS: react-native-geolocation: 580c86eb531c0aaf7a14bc76fd2983ce47ca58aa react-native-image-picker: f8a13ff106bcc7eb00c71ce11fdc36aac2a44440 react-native-key-command: 28ccfa09520e7d7e30739480dea4df003493bfe8 - react-native-keyboard-controller: 47c01b0741ae5fc84e53cf282e61cfa5c2edb19b + react-native-keyboard-controller: 9ce53a30cdcfd552994105fdcf3ffbd4c314a181 react-native-launch-arguments: 5f41e0abf88a15e3c5309b8875d6fd5ac43df49d react-native-netinfo: 02d31de0e08ab043d48f2a1a8baade109d7b6ca5 react-native-pager-view: ccd4bbf9fc7effaf8f91f8dae43389844d9ef9fa From bdf829db3e4a5db200f22138a731dbdf2eb65dd6 Mon Sep 17 00:00:00 2001 From: kirillzyusko Date: Fri, 9 Aug 2024 10:58:33 +0200 Subject: [PATCH 3/4] fix: bump keyboard-controller and fix CI --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6d36a205d660..bd6a35fd1102 100644 --- a/package-lock.json +++ b/package-lock.json @@ -97,7 +97,7 @@ "react-native-image-picker": "^7.0.3", "react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#bf3ad41a61c4f6f80ed4d497599ef5247a2dd002", "react-native-key-command": "^1.0.8", - "react-native-keyboard-controller": "https://github.com/kirillzyusko/react-native-keyboard-controller.git#cfc62b7", + "react-native-keyboard-controller": "https://github.com/kirillzyusko/react-native-keyboard-controller.git#10a90ae", "react-native-launch-arguments": "^4.0.2", "react-native-linear-gradient": "^2.8.1", "react-native-localize": "^2.2.6", @@ -37290,7 +37290,7 @@ }, "node_modules/react-native-keyboard-controller": { "version": "1.12.7", - "resolved": "git+ssh://git@github.com/kirillzyusko/react-native-keyboard-controller.git#cfc62b748af943eacbaffb77fe44873638fbbb07", + "resolved": "git+ssh://git@github.com/kirillzyusko/react-native-keyboard-controller.git#10a90ae7ebe7334672145d3ea891ed7701a25ab4", "peerDependencies": { "react": "*", "react-native": "*", diff --git a/package.json b/package.json index 5fdbb7e6e7fc..855b7d0c591d 100644 --- a/package.json +++ b/package.json @@ -155,7 +155,7 @@ "react-native-image-picker": "^7.0.3", "react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#bf3ad41a61c4f6f80ed4d497599ef5247a2dd002", "react-native-key-command": "^1.0.8", - "react-native-keyboard-controller": "https://github.com/kirillzyusko/react-native-keyboard-controller.git#cfc62b7", + "react-native-keyboard-controller": "https://github.com/kirillzyusko/react-native-keyboard-controller.git#10a90ae", "react-native-launch-arguments": "^4.0.2", "react-native-linear-gradient": "^2.8.1", "react-native-localize": "^2.2.6", From 7db099c521c3451f96f5f6b487456b2bc72442d9 Mon Sep 17 00:00:00 2001 From: kirillzyusko Date: Fri, 16 Aug 2024 11:37:08 +0200 Subject: [PATCH 4/4] chore: use version from npm --- ios/Podfile.lock | 12 +++++++++--- package-lock.json | 9 +++++---- package.json | 2 +- ...=> react-native-keyboard-controller+1.13.0.patch} | 0 4 files changed, 15 insertions(+), 8 deletions(-) rename patches/{react-native-keyboard-controller+1.12.7.patch => react-native-keyboard-controller+1.13.0.patch} (100%) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 971764329c48..b67039462cb3 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -1243,7 +1243,13 @@ PODS: - react-native-config (1.5.0): - react-native-config/App (= 1.5.0) - react-native-config/App (1.5.0): - - React-Core + - RCT-Folly + - RCTRequired + - RCTTypeSafety + - React + - React-Codegen + - React-RCTFabric + - ReactCommon/turbomodule/core - react-native-document-picker (9.1.1): - RCT-Folly - RCTRequired @@ -1297,7 +1303,7 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga - - react-native-keyboard-controller (1.12.7): + - react-native-keyboard-controller (1.13.0): - glog - hermes-engine - RCT-Folly (= 2022.05.16.00) @@ -2559,7 +2565,7 @@ SPEC CHECKSUMS: react-native-geolocation: 580c86eb531c0aaf7a14bc76fd2983ce47ca58aa react-native-image-picker: f8a13ff106bcc7eb00c71ce11fdc36aac2a44440 react-native-key-command: 28ccfa09520e7d7e30739480dea4df003493bfe8 - react-native-keyboard-controller: 9ce53a30cdcfd552994105fdcf3ffbd4c314a181 + react-native-keyboard-controller: a8cbf848d0bc0e1976a07948f1c53b8432c1246c react-native-launch-arguments: 5f41e0abf88a15e3c5309b8875d6fd5ac43df49d react-native-netinfo: 02d31de0e08ab043d48f2a1a8baade109d7b6ca5 react-native-pager-view: ccd4bbf9fc7effaf8f91f8dae43389844d9ef9fa diff --git a/package-lock.json b/package-lock.json index bd6a35fd1102..0699cf8c7056 100644 --- a/package-lock.json +++ b/package-lock.json @@ -97,7 +97,7 @@ "react-native-image-picker": "^7.0.3", "react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#bf3ad41a61c4f6f80ed4d497599ef5247a2dd002", "react-native-key-command": "^1.0.8", - "react-native-keyboard-controller": "https://github.com/kirillzyusko/react-native-keyboard-controller.git#10a90ae", + "react-native-keyboard-controller": "1.13.0", "react-native-launch-arguments": "^4.0.2", "react-native-linear-gradient": "^2.8.1", "react-native-localize": "^2.2.6", @@ -37289,12 +37289,13 @@ "license": "MIT" }, "node_modules/react-native-keyboard-controller": { - "version": "1.12.7", - "resolved": "git+ssh://git@github.com/kirillzyusko/react-native-keyboard-controller.git#10a90ae7ebe7334672145d3ea891ed7701a25ab4", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/react-native-keyboard-controller/-/react-native-keyboard-controller-1.13.0.tgz", + "integrity": "sha512-bMRx94Mt+HOkh6WRkShYgbszUcF+S9OWYHUT+DhFK9/nm1AxmDoMQKorDdb4XUXJgxrDe2k46fx4eAA6BZm/wA==", "peerDependencies": { "react": "*", "react-native": "*", - "react-native-reanimated": ">=2.11.0" + "react-native-reanimated": ">=3.0.0" } }, "node_modules/react-native-launch-arguments": { diff --git a/package.json b/package.json index 855b7d0c591d..8d26b37704f0 100644 --- a/package.json +++ b/package.json @@ -155,7 +155,7 @@ "react-native-image-picker": "^7.0.3", "react-native-image-size": "git+https://github.com/Expensify/react-native-image-size#bf3ad41a61c4f6f80ed4d497599ef5247a2dd002", "react-native-key-command": "^1.0.8", - "react-native-keyboard-controller": "https://github.com/kirillzyusko/react-native-keyboard-controller.git#10a90ae", + "react-native-keyboard-controller": "1.13.0", "react-native-launch-arguments": "^4.0.2", "react-native-linear-gradient": "^2.8.1", "react-native-localize": "^2.2.6", diff --git a/patches/react-native-keyboard-controller+1.12.7.patch b/patches/react-native-keyboard-controller+1.13.0.patch similarity index 100% rename from patches/react-native-keyboard-controller+1.12.7.patch rename to patches/react-native-keyboard-controller+1.13.0.patch