Skip to content

aspectRatio + undefined width/height #22979

Closed
@santiph

Description

@santiph

Environment

React Native Environment Info:
    System:
      OS: Linux 4.15 Ubuntu 18.04.1 LTS (Bionic Beaver)
      CPU: (12) x64 AMD Ryzen 5 2600X Six-Core Processor
      Memory: 15.10 GB / 31.34 GB
      Shell: 2.7.1 - /usr/bin/fish
    Binaries:
      Node: 8.10.0 - /usr/bin/node
      npm: 3.5.2 - /usr/bin/npm
    npmPackages:
      react: 16.6.3 => 16.6.3 
      react-native: 0.57.8 => 0.57.8 
    npmGlobalPackages:
      react-native-cli: 2.0.1
      react-native-git-upgrade: 0.2.7

Description

aspectRatio and height: 100% seem to work only when width is set to undefined, but with aspectRatio and width set, then height is not required at all. (See Demo)
Why is that?

Reproducible Demo

Working fine:

aspectRatio: 1,
width: '100%',
aspectRatio: 1,
height: '100%',
width: undefined,

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions