React-modal: z-index value not handled correctly

Created on 5 Nov 2015  路  4Comments  路  Source: reactjs/react-modal

Consider:

class Foo extends Component {
  render() {
    var modalStyles = {overlay: {}};
    modalStyles.overlay["z-index"] = 10;

    return(
      <Modal style={ modalStyles }>
        Hello World!
      </Modal>
    )
  }
}

This will produce a modal with a z-index of "10px", which is not a valid z-index value.

Most helpful comment

It should follow react conventions:

class Foo extends Component {
  render() {
    var modalStyles = {overlay: {zIndex: 10}};

    return(
      <Modal style={ modalStyles }>
        Hello World!
      </Modal>
    )
  }
}

All 4 comments

As a workaround set modalStyles.overlay["z-index"] = '10;';

It should follow react conventions:

class Foo extends Component {
  render() {
    var modalStyles = {overlay: {zIndex: 10}};

    return(
      <Modal style={ modalStyles }>
        Hello World!
      </Modal>
    )
  }
}

@marbemac Thanks for the tip!

@marbemac I should have realized that. Thanks for the example.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kinucris picture kinucris  路  3Comments

ChristopherVH picture ChristopherVH  路  3Comments

leoasis picture leoasis  路  4Comments

petertdinh picture petertdinh  路  4Comments

gavmck picture gavmck  路  3Comments