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

Unable to tap Touchable components inside the screen when transparentCard config is true in Stack Navigator - Android only #159

Closed
DaniAkash opened this issue Sep 19, 2019 · 11 comments

Comments

@DaniAkash
Copy link

I have been using the transparentCard property from https://reactnavigation.org/docs/en/stack-navigator.html#stacknavigatorconfig to make the screens transparent to implement modals and action sheets. However, after using react-native-screens, transparency is not working

@DaniAkash DaniAkash changed the title transparentCard config doesn't work in Stack Navigator transparentCard config doesn't work in Stack Navigator Sep 19, 2019
@romant37
Copy link

+1, Same problem

@nanthawat
Copy link

nanthawat commented Sep 23, 2019

try
#61 (comment)

@romant37
Copy link

romant37 commented Sep 24, 2019

Finally I resolve this issue, just add (containerStyleLight and containerStyleDark) in transitionConfig function

containerStyle: {
  backgroundColor: 'transparent',
},
containerStyleLight: {
  backgroundColor: 'transparent',
},
containerStyleDark: {
  backgroundColor: 'transparent',
},

Solution was found in react-navigation-stack https://github.com/react-navigation/stack/issues/232

@DaniAkash
Copy link
Author

DaniAkash commented Sep 26, 2019

@romant37 thanks for the solution. However, now I'm facing a weird problem which prevents me from clicking any <TouchableOpacity/> component inside my screens when transparentCard config is active (only on Android). I'm only enabling transparent card for iOS at the moment.

@DaniAkash DaniAkash changed the title transparentCard config doesn't work in Stack Navigator Unable to tap Touchable components inside the screen when transparentCard config is true in Stack Navigator - Android only Sep 26, 2019
@romant37
Copy link

@DaniAkash if you use useScreens() function, try to remove it
https://reactnavigation.org/docs/en/react-native-screens.html
related issue #79

@Lipo11
Copy link

Lipo11 commented Nov 26, 2019

@kmagiera is there any update on this issue?

@ukasiu
Copy link

ukasiu commented Nov 26, 2019

Hey @Lipo11,

try to use https://github.com/kmagiera/react-native-screens/blob/master/createNativeStackNavigator.js for the navigator with transparentCard enabled. It solved the problem for me :)

@Lipo11
Copy link

Lipo11 commented Nov 28, 2019

Hey @ukasiu

Yep, i know, but I'm using the custom animations ( param transitionConfig ), which is not supported into createNativeStackNavigator.js
So, the best option for me is fix the issue.

For now, I use react-native-screens only for iOS.
Thank you!

@WoLewicki
Copy link
Member

Does the issue still exist in the newest version? If so, can you provide a repo with minimal configuration needed to recreate the issue?

@WoLewicki
Copy link
Member

I am closing it due to no response in more than 30 days. Feel free to comment to reopen it.

@fawazahmed-makeen
Copy link

Issue seems to be fixed with react-navigation v4.4.0, since there is no prop transparentCard and just use the cardStyle.
import { createStackNavigator, TransitionPresets } from 'react-navigation-stack';
Use defaultNavigationOptions for stack navigator config.

createStackNavigator({
  // routes
}, {
// other config
defaultNavigationOptions: ({ navigation }) => {
    return {
      gesturesEnabled: false,
      cardStyle: {
        shadowColor: 'transparent',
        backgroundColor: 'transparent',
        opacity: 1,
      },
      ...TransitionPresets.ModalSlideFromBottomIOS, // or whichever
    }
  },
})

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