Skip to content

Commit

Permalink
chore: align patch to react-navigation main code (which is not publis…
Browse files Browse the repository at this point in the history
…hed to npm yet)
  • Loading branch information
kirillzyusko committed Feb 7, 2024
1 parent 10abe0b commit 7073fdc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 8 additions & 6 deletions patches/@react-navigation+native-stack+6.9.17.patch
Original file line number Diff line number Diff line change
@@ -1,37 +1,39 @@
diff --git a/node_modules/@react-navigation/native-stack/src/types.tsx b/node_modules/@react-navigation/native-stack/src/types.tsx
index 206fb0b..7104b93 100644
index 206fb0b..7a34a8e 100644
--- a/node_modules/@react-navigation/native-stack/src/types.tsx
+++ b/node_modules/@react-navigation/native-stack/src/types.tsx
@@ -490,6 +490,12 @@ export type NativeStackNavigationOptions = {
@@ -490,6 +490,14 @@ export type NativeStackNavigationOptions = {
* Only supported on iOS and Android.
*/
freezeOnBlur?: boolean;
+ // partial changes from https://github.com/react-navigation/react-navigation/commit/90cfbf23bcc5259f3262691a9eec6c5b906e5262
+ // patch can be removed when new version of `native-stack` will be released
+ /**
+ * Whether the keyboard should hide when swiping to the previous screen. Defaults to `false`.
+ *
+ * Only supported on iOS
+ */
+ hideKeyboardOnSwipe?: boolean;
+ keyboardHandlingEnabled?: boolean;
};

export type NativeStackNavigatorProps = DefaultNavigatorOptions<
diff --git a/node_modules/@react-navigation/native-stack/src/views/NativeStackView.native.tsx b/node_modules/@react-navigation/native-stack/src/views/NativeStackView.native.tsx
index a005c43..dc22c63 100644
index a005c43..03d8b50 100644
--- a/node_modules/@react-navigation/native-stack/src/views/NativeStackView.native.tsx
+++ b/node_modules/@react-navigation/native-stack/src/views/NativeStackView.native.tsx
@@ -161,6 +161,7 @@ const SceneView = ({
statusBarTranslucent,
statusBarColor,
freezeOnBlur,
+ hideKeyboardOnSwipe,
+ keyboardHandlingEnabled,
} = options;

let {
@@ -289,6 +290,7 @@ const SceneView = ({
onNativeDismissCancelled={onNativeDismissCancelled}
// this prop is available since rn-screens 3.16
freezeOnBlur={freezeOnBlur}
+ hideKeyboardOnSwipe={hideKeyboardOnSwipe}
+ hideKeyboardOnSwipe={keyboardHandlingEnabled}
>
<NavigationContext.Provider value={navigation}>
<NavigationRouteContext.Provider value={route}>
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const getRootNavigatorScreenOptions: GetRootNavigatorScreenOptions = (isSmallScr
cardStyleInterpolator: (props: StackCardInterpolationProps) => modalCardStyleInterpolator(isSmallScreenWidth, true, props),
// temporary solution - better to hide a keyboard than see keyboard flickering
// see https://github.com/software-mansion/react-native-screens/issues/2021 for more details
hideKeyboardOnSwipe: true,
keyboardHandlingEnabled: true,
cardStyle: {
...StyleUtils.getNavigationModalCardStyle(),
paddingRight: isSmallScreenWidth ? 0 : variables.sideBarWidth,
Expand Down

0 comments on commit 7073fdc

Please sign in to comment.