Skip to content

Menu appearing behind other components #4770

@ffkraemer

Description

@ffkraemer

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

Problem: Menu was appearing behind other components.

Before:
Image

After:
Image

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-paper/lib/typescript/core/PaperProvider.d.ts b/node_modules/react-native-paper/lib/typescript/core/PaperProvider.d.ts
index de236cc..feeba5f 100644
--- a/node_modules/react-native-paper/lib/typescript/core/PaperProvider.d.ts
+++ b/node_modules/react-native-paper/lib/typescript/core/PaperProvider.d.ts
@@ -5,6 +5,7 @@ export type Props = {
     children: React.ReactNode;
     theme?: ThemeProp;
     settings?: Settings;
+    style?: StyleProp<ViewStyle>;
 };
 declare const PaperProvider: (props: Props) => React.JSX.Element;
 export default PaperProvider;
diff --git a/node_modules/react-native-paper/src/core/PaperProvider.tsx b/node_modules/react-native-paper/src/core/PaperProvider.tsx
index 51839a5..d8f1a16 100644
--- a/node_modules/react-native-paper/src/core/PaperProvider.tsx
+++ b/node_modules/react-native-paper/src/core/PaperProvider.tsx
@@ -4,6 +4,8 @@ import {
   Appearance,
   ColorSchemeName,
   NativeEventSubscription,
+  StyleProp,
+  ViewStyle,
 } from 'react-native';
 
 import SafeAreaProviderCompat from './SafeAreaProviderCompat';
@@ -18,6 +20,7 @@ export type Props = {
   children: React.ReactNode;
   theme?: ThemeProp;
   settings?: Settings;
+  style?: StyleProp<ViewStyle>;
 };
 
 const PaperProvider = (props: Props) => {
@@ -109,7 +112,7 @@ const PaperProvider = (props: Props) => {
   );
 
   return (
-    <SafeAreaProviderCompat>
+     <SafeAreaProviderCompat style={props.style}>
       <PortalHost>
         <SettingsProvider value={settingsValue}>
           <ThemeProvider theme={theme}>{children}</ThemeProvider>

This issue body was partially generated by patch-package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions