question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug inline styles flex value

See original GitHub issue

Steps to Reproduce: https://jsfiddle.net/reactjs/69z2wepo/

class Hello extends React.Component {
  render() {
    return <div style={{ flex: '1 0 0' }}>Hello</div>;
  }
}
ReactDOM.render(
  <Hello />,
  document.getElementById('container')
);

Expected Result: <div style="flex: 1 0 0;">Hello</div>

Actual Result: <div style="flex: 1 0 0px;">Hello</div>

Notes: Why change 0 to 0px ?? I’m not sure IE11 works with 0 the same way as 0px… Also why not change the second digit then also? 0px and 0 is the same also, so the suffixing of px there is just a waste and can cause potential bugs.

https://stackoverflow.com/a/22883146/846348

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
gaearoncommented, Nov 1, 2018

I verified all React does is set node.style.flex = '1 0 0'. React doesn’t append any px suffix so you’re dealing with some browser issue here.

0reactions
OZZlEcommented, Mar 15, 2019

@gaearon it should put node.style.flex = '1' because that is what I wrote… why does it need to mess up IE11??

I have to use a stylesheet to get flex: 1; because inline is modified from what I actually wrote!!!

Read more comments on GitHub >

github_iconTop Results From Across the Web

css - What's the difference between display:inline-flex and ...
The difference between display: flex and display: inline-flex is the outer display type, the first's outer display type is block , and the...
Read more >
flex-basis - CSS: Cascading Style Sheets - MDN Web Docs
The flex-basis CSS property sets the initial main size of a flex item. It sets the size of the content box unless otherwise...
Read more >
What is the difference between inline-flex and inline-block in ...
The display property specifies how an element should be displayed in a webpage. There can be many values, related to this property in...
Read more >
Class and Style Bindings | Vue.js
This will only render the last value in the array which the browser supports. In this example, it will render display: flex for...
Read more >
CSS Flexbox Container - W3Schools
The column value stacks the flex items vertically (from top to bottom): · flex-direction: column; ; The column-reverse value stacks the flex items...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found