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

React Native hidden overflow child behavior #1553

Closed
ocapio opened this issue Dec 15, 2017 · 3 comments
Closed

React Native hidden overflow child behavior #1553

ocapio opened this issue Dec 15, 2017 · 3 comments
Labels

Comments

@ocapio
Copy link

ocapio commented Dec 15, 2017

Environment

  1. react-native -v:
    react-native-cli: 2.0.1
    react-native: 0.50.4
  2. npm ls rnpm-plugin-windows:
    [email protected] C:\src\react-native-windows
  3. npm ls react-native-windows:
    [email protected] C:\src\react-native-windows
  4. node -v:
    v7.5.0
  5. npm -v:
    4.1.2
  6. yarn --version:

Then, specify:

  • Target Platform: IOS, Android and UWP
  • Target Platform Version(s):
    Building from source whatever is master - UWP.
  • Target Device(s):
  • Development Operating System: Windows
  • Visual Studio Version:
    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.

Are there any specification on how View items are rendered as a child of a View item with the hidden overflow property?

(Write your steps here:)

  1. Just modify the Playground index.windows.js with the following:

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:
screenshot_20171212-153130

Windows:
screen-shot-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:
screen-shot-windows-background

However, this doesn't have an effect in Android.

If rendering should follow standard CSS. Here is a screenshot of HTML:
screenshot_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

@rozele
Copy link
Collaborator

rozele commented Dec 21, 2017

@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?

@rozele
Copy link
Collaborator

rozele commented Dec 21, 2017

@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.

@rozele rozele added the .NET label Feb 26, 2019
@chrisglein chrisglein added the .NET Archive Issue opened against deprecated .NET implementation, will be closed (label drives bot activity) label Oct 25, 2019
@ghost
Copy link

ghost commented Oct 25, 2019

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.

@ghost ghost removed the .NET Archive Issue opened against deprecated .NET implementation, will be closed (label drives bot activity) label Oct 25, 2019
@chrisglein chrisglein added the .NET Archive Issue opened against deprecated .NET implementation, will be closed (label drives bot activity) label Oct 25, 2019
@ghost ghost removed the .NET Archive Issue opened against deprecated .NET implementation, will be closed (label drives bot activity) label Oct 25, 2019
@ghost ghost closed this as completed Oct 25, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants