react-flexview icon indicating copy to clipboard operation
react-flexview copied to clipboard

FlexView ignores basis prop when value is 0

Open Rifdhan opened this issue 5 years ago • 1 comments

If I try to pass a value of 0 for the basis prop, the FlexView will ignore that and leave the basis at auto (its default). This can also be seen on the live playground (in the interactive section at the bottom, try entering 0 as the basis).

I suspect this is happening because of an if-condition that checks the value of basis, and a value of 0 evaluates to be falsy, so the if-block acts as if no basis prop was provided. This is potentially happening in FlexView.tsx, on line 201, in the getBasis function.

Rifdhan avatar Jul 02 '20 22:07 Rifdhan

Hi @Rifdhan , thanks for the report, it looks like a valid bug to me. Would you like to submit a PR to fix it?

giogonzo avatar Jul 07 '20 18:07 giogonzo