Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix flexGrow={0}, flexShrink={0} #2634

Merged
merged 2 commits into from
Jul 11, 2023
Merged

Conversation

neildecapia
Copy link
Contributor

@neildecapia neildecapia commented Jul 10, 2023

What does this PR do? A clear and concise description with your runway ticket url.

Setting the global props flexGrow and flexShrink to 0 doesn't work
because they are emitted using a truthiness check, which 0 fails.

This results in flexGrow={0} returning an empty string and not adding
the flex_grow_0 class and consequently not applying the `flex-grow: 0;'
style to the component.

This commit fixes the bug by replacing the truthiness check with an inclusion
check using the Binary type of the flexGrow and flexShrink
props.

Screenshots: Screenshots to visualize your addition/change

N/A

How to test? Steps to confirm the desired behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See addition/change

Checklist:

  • LABELS Add a label: enhancement, bug, improvement, new kit, deprecated, or breaking. See Changelog & Labels for details.
  • DEPLOY I have added the milano label to show I'm ready for a review.
  • TESTS I have added test coverage to my code.

@neildecapia neildecapia added the bug Fixes to issues discovered in Playbook (USED IN CHANGELOG) label Jul 10, 2023
@neildecapia neildecapia requested a review from a team as a code owner July 10, 2023 14:02
@neildecapia neildecapia added the milano 20 MAX - Deploy this PR to a review environment via Milano label Jul 10, 2023
@app-milano app-milano bot temporarily deployed to pr2634 July 10, 2023 14:24 Inactive
jasperfurniss
jasperfurniss previously approved these changes Jul 11, 2023
@jasperfurniss jasperfurniss added the Ready for Release merged to master, ready for a versioned released label Jul 11, 2023
@app-milano app-milano bot temporarily deployed to pr2634 July 11, 2023 11:51 Inactive
Setting the global props `flexGrow` and `flexShrink` to `0` doesn't work
because they are emitted using a truthiness check, which `0` fails.

This results in `flexGrow={0}` returning an empty string and not adding
the `flex_grow_0` class and consequently not applying the `flex-grow:
0;' style to the component.

This commit fixes the bug by replacing the truthiness check with an
inclusion check using the `Binary` type of the `flexGrow` and
`flexShrink` props.

Signed-off-by: Jasper <jasperfurniss@gmail.com>
@nidaqg nidaqg added this pull request to the merge queue Jul 11, 2023
Merged via the queue into master with commit 9f1bbea Jul 11, 2023
@nidaqg nidaqg deleted the flex-grow-shrink-0-props-fix branch July 11, 2023 18:09
@neildecapia
Copy link
Contributor Author

Thanks, @jasperfurniss and @nidaqg! I won't mess up the commit next time. 😊

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Fixes to issues discovered in Playbook (USED IN CHANGELOG) milano 20 MAX - Deploy this PR to a review environment via Milano Ready for Release merged to master, ready for a versioned released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants