-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
React Native hidden overflow child behavior #1553
Comments
@ocapio thanks for reporting. React Native uses some flex defaults - can you apply the same flex defaults to the Web solution and post that here? |
@ocapio - it looks like iOS is the only correct implementation. I think it's a known issue that overflow: visible doesn't work on Android (facebook/react-native#17074). It concerns me that you need to set a transparent background on the parent View container to get Windows to match iOS. I'll investigate. |
We are not investing in new features or lower priority bug fixes on vCurrent. The bulk of investment is now in vNext as we prepare to make that the default choice. If this issue is still relevant on the vNext implementation please open a vNext issue. If this issue is of significant severity for a vCurrent app and vNext is not an option, re-open with justification. |
Environment
react-native -v
:react-native-cli: 2.0.1
react-native: 0.50.4
npm ls rnpm-plugin-windows
:react-native-windows@1000.0.0 C:\src\react-native-windows
npm ls react-native-windows
:react-native-windows@1000.0.0 C:\src\react-native-windows
node -v
:v7.5.0
npm -v
:4.1.2
yarn --version
:Then, specify:
Building from source whatever is master - UWP.
Visual Studio 2017 v15.4.5
Steps to Reproduce
This is from a question in reactiflux under the react-native-platform channels. username: facelessraven.
I've been asked by matt to file an issue. This is more of a question regarding rendering behavior between all the react-native platforms.
(Write your steps here:)
class Playground extends Component { render() { return ( <View style={{ width: 200, height: 200, margin: 60, backgroundColor: 'blue', overflow: 'visible' }}> <View style={{ width: 100, height: 100, backgroundColor: 'green', marginLeft: -50 }} /> <View style={{ overflow: 'hidden' }}> <View style={{ width: 100, height: 100, backgroundColor: 'orange', marginLeft: -50 }} /> </View> </View> ); } }
Expected Behavior
I am not sure what is the expected behavior that is why I am asking.
Actual Behavior
The rendering matches that of Android:

Windows:

However, if we add something like a transparent background to the hidden overflow element.
i.e.
<View style={{ backgroundColor: 'rgba(0,0,0,0)', overflow: 'hidden' }}>
The rendering will be more like IOS:

However, this doesn't have an effect in Android.
If rendering should follow standard CSS. Here is a screenshot of HTML:

So who is rendering this correctly and is there any specifications? Do children inherit the parent properties or use some other default values?
Reproducible Demo
Here is a snack demo demonstrating the IOS and Android behavior.
https://snack.expo.io/@ocapio/nested-view-behavior
Thanks
The text was updated successfully, but these errors were encountered: