Skip to content

display: none does not work as expected with position: absolute #7289

@rozele

Description

@rozele

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Add an example to ViewExample.windows.js in RNTester:
  {
    title: 'display: none and position: absolute',
    render: function(): React.Node {
      return (
        <>
          <View
            style={{
              height: 100,
              width: 100,
              justifyContent: 'center',
              alignItems: 'center',
              backgroundColor: 'red',
              position: 'absolute',
              display: 'none',
              top: 0,
            }}>
            <Text>This should be hidden.</Text>
          </View>
        </>
      );
    }
  }
  1. Run the example in RNTester
  2. Observe that the view is still displayed.

Expected Results

The display: none prop value should result in the view being hidden.

Snack, code example, screenshot, or link to a repository:

rozele@e611541

image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions