lightning-js / blits

The Lightning 3 App Development Framework
Apache License 2.0
63 stars 10 forks source link

Text component failed to render 0 #2

Closed suresh-gangumalla closed 11 months ago

suresh-gangumalla commented 11 months ago

[Issue] Found Text component failed to render 0 (numeric) value

[Reason] Logical OR statment in computed method 'text' in Text component

[Fix] Added check for zero value for both slotContent and content

michielvandergeest commented 11 months ago

hey @suresh-gangumalla thanks for this PR. You are right that the conditional in the Text component fails when the content has a falsy value.

While your PR fixes that case, I think it can better be fixed in a different place (at the code generator level). The feature/inline-text-support-branch (WIP) approaches it a different, and should properly accept falsy values for text content. So I'll close this PR, in lieu of that upcoming change.

Thanks in any case for bringing this bug to the attention!