Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Click not responding on second page onwards #836

Closed
nikhil-alr opened this issue Jun 19, 2024 · 14 comments
Closed

Click not responding on second page onwards #836

nikhil-alr opened this issue Jun 19, 2024 · 14 comments

Comments

@nikhil-alr
Copy link

nikhil-alr commented Jun 19, 2024

Environment

Android 14 Oxygen OS One plus 8 pro
Running app by enabling new architecture

Description

When running example app using v7.0.0-rc.2 by enabling new architecture on second page onwards button not responding.

Reproducible Demo

Record_2024-06-19-13-43-08.mp4

Step to Produce

1.Clone library repo
2.Switch to v7.0.0-rc.2 branch
3.Do npm install
4.set enable new arch true
5.run app in Android 14 Oxygen OS One plus 8 pro

@MrRefactor
Copy link
Collaborator

Try with 6.3.3 version

@troZee troZee added the next label Jun 20, 2024
@NikhilKamboja
Copy link

NikhilKamboja commented Jun 20, 2024

Issue still persists on 6.3.3 with new Arch on Android 14 Oxygen OS One plus 8 pro
PFA

Record_2024-06-20-12-27-27.mp4

@dengcqw
Copy link

dengcqw commented Jul 5, 2024

utils.tsx L21

export const childrenWithOverriddenStyle = (
  children?: ReactNode,
  pageMargin = 0
) => {
  return Children.map(children, (child) => {
    return (
      <View
        style={{
          ...StyleSheet.absoluteFill,    // fix it by add this
          height: '100%',
          width: '100%',
          paddingHorizontal: pageMargin / 2,
        }}
        collapsable={false}
      >
        {child}
      </View>
    );
  });
};

@NikhilKamboja
Copy link

@dengcqw thanks it's working now
We can close this issue

@NikhilKamboja
Copy link

Hi team can you tell way forward to officially fix this issue.
Any plan to release a patch?

Thanks

@MrRefactor
Copy link
Collaborator

I will create PR for it soon.

@MrRefactor
Copy link
Collaborator

@NikhilKamboja I cannot reproduce it on android14, checked both js and native stack with new arch, did you apply any other changes?

@MrRefactor
Copy link
Collaborator

Screen.Recording.2024-07-18.at.17.16.14.mov

@NikhilKamboja
Copy link

Can you please check Android 14 Oxygen OS One plus 8 pro Real Device

@sriharsha-y
Copy link

sriharsha-y commented Jul 29, 2024

utils.tsx L21

export const childrenWithOverriddenStyle = (
  children?: ReactNode,
  pageMargin = 0
) => {
  return Children.map(children, (child) => {
    return (
      <View
        style={{
          ...StyleSheet.absoluteFill,    // fix it by add this
          height: '100%',
          width: '100%',
          paddingHorizontal: pageMargin / 2,
        }}
        collapsable={false}
      >
        {child}
      </View>
    );
  });
};

We are using react-native-tab-view which internally uses this library. With ...StyleSheet.absoluteFill I don't see any issue in OnePlus physical device (Android 14 - Color OS), but now issue happens with iOS where the views are retained or never removed between tab switches. Conditionally putting ...StyleSheet.absoluteFill for Android works for both Android & iOS for tab switches. Not sure what the right approach would be here....

@MrRefactor
Copy link
Collaborator

hey @NikhilKamboja please check if those changes are fixing it:

diff --git a/node_modules/react-native-pager-view/src/utils.tsx b/node_modules/react-native-pager-view/src/utils.tsx
index 0d7d265..2f022a4 100644
--- a/node_modules/react-native-pager-view/src/utils.tsx
+++ b/node_modules/react-native-pager-view/src/utils.tsx
@@ -1,5 +1,5 @@
 import React, { Children, ReactNode } from 'react';
-import { StyleSheet, View } from 'react-native';
+import { Platform, StyleSheet, View } from 'react-native';

 export const LEGACY_childrenWithOverriddenStyle = (children?: ReactNode) => {
   return Children.map(children, (child) => {
@@ -29,6 +29,7 @@ export const childrenWithOverriddenStyle = (
           height: '100%',
           width: '100%',
           paddingHorizontal: pageMargin / 2,
+          position: Platform.OS === 'android' ? 'absolute' : undefined,
         }}
         collapsable={false}
       >

@hannojg
Copy link

hannojg commented Aug 23, 2024

@MrRefactor we face this problem in expensify right now. With the proposed change the issue is fixed for this issue ticket:

would appreciate if we could add this change to the library 🙏

(see this slack thread)

@NikhilKamboja
Copy link

hey @NikhilKamboja please check if those changes are fixing it:

diff --git a/node_modules/react-native-pager-view/src/utils.tsx b/node_modules/react-native-pager-view/src/utils.tsx
index 0d7d265..2f022a4 100644
--- a/node_modules/react-native-pager-view/src/utils.tsx
+++ b/node_modules/react-native-pager-view/src/utils.tsx
@@ -1,5 +1,5 @@
 import React, { Children, ReactNode } from 'react';
-import { StyleSheet, View } from 'react-native';
+import { Platform, StyleSheet, View } from 'react-native';

 export const LEGACY_childrenWithOverriddenStyle = (children?: ReactNode) => {
   return Children.map(children, (child) => {
@@ -29,6 +29,7 @@ export const childrenWithOverriddenStyle = (
           height: '100%',
           width: '100%',
           paddingHorizontal: pageMargin / 2,
+          position: Platform.OS === 'android' ? 'absolute' : undefined,
         }}
         collapsable={false}
       >

HI @MrRefactor it's working please go ahead

@MrRefactor
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants