Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[Bug]: Stack in @fluentui/react version 8.101.2 changed to rendering falsy elements instead of returning null causes zeros to render #28970

Closed
2 tasks done
ghadnani opened this issue Aug 24, 2023 · 2 comments · Fixed by #28978
Labels
Fluent UI react (v8) Issues about @fluentui/react (v8) Needs: Triage 🔍

Comments

@ghadnani
Copy link

ghadnani commented Aug 24, 2023

Library

React / v8 (@fluentui/react)

System Info

react v. 16
@fluentui/react v. 8.101.2

Stack in @fluentui/react version 8.101.2 changed to rendering falsy elements instead of returning null. 

This change caused many zeroes to appear in Stack's children that were zeroes but consumers were expecting them to be nulled by Stack. 

This is a breaking change on our side as consumers.

Here is a codepen demonstrating the behavior expected in 8.101.1
https://codepen.io/ghadnani/pen/oNJXMBL

And here is a codepen demonstrating the breaking change in 8.101.2
https://codepen.io/ghadnani/pen/mdaJjRw

Expected:
image

Rendered:
image

Are you reporting Accessibility issue?

None

Reproduction

https://codepen.io/ghadnani/pen/mdaJjRw

Bug Description

Actual Behavior

Zeroes and other falsy elements changed to being rendered by Stack.

Expected Behavior

Zeroes and other falsy elements to continue being nulled out by Stack.

Logs

No response

Requested priority

Normal

Products/sites affected

AMC (account.microsoft.com)

Are you willing to submit a PR to fix?

no

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.
@github-actions github-actions bot added the Fluent UI react (v8) Issues about @fluentui/react (v8) label Aug 24, 2023
@ghadnani ghadnani changed the title [Bug]: Stack in @fluentui/react version 8.101.2 changed to rendering falsy elements instead of returning null. This caused many zeroes to appear in Stack's children that were zeroes and expected to be nulled by Stack. [Bug]: Stack in @fluentui/react version 8.101.2 changed to rendering falsy elements instead of returning null. This change caused many zeroes to appear in Stack's children that were zeroes expected to be nulled by Stack. Aug 24, 2023
@micahgodbolt micahgodbolt changed the title [Bug]: Stack in @fluentui/react version 8.101.2 changed to rendering falsy elements instead of returning null. This change caused many zeroes to appear in Stack's children that were zeroes expected to be nulled by Stack. [Bug]: Stack in @fluentui/react version 8.101.2 changed to rendering falsy elements instead of returning null causes zeros to render Aug 24, 2023
@micahgodbolt
Copy link
Member

This behavior was initially changed in #25685

@sopranopillow
Copy link
Contributor

To give more clarification, this was done so in case you want to render something like a list of numbers where 0 is valid. The previous behavior is actually a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Fluent UI react (v8) Issues about @fluentui/react (v8) Needs: Triage 🔍
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants