<aura:if> rendering inconsistent

Issue #606 resolved
Derek Wiers created an issue

See screenshot. <aura:if> is a handy lightning tool to conditionally render part of a page/component - its single attribute, "isTrue", is designed to take an expression in braces {!...} that returns a boolean. Oddly enough, IC actually wants a literal "true" or "false" value, and braces actually make it turn red - but not all the time. As you can see in the screenshot, it flags the first usage as "Wrong attribute value" but not subsequent usages of the tag. Not a deal breaker by any means - it all compiles just fine - I just thought it odd.

Comments (6)

  1. Scott Wells repo owner

    Yeah, the issue is that IC supports component/attribute completions by registering an XSD for each namespace (e.g., aura, ltng, etc.). This works REALLY well overall, but when you have an XSD attribute of type xsd:boolean, it expects only variants of true and false. The {!...} expressions are effectively evaluated as empty from the XSD processor's standpoint. Ideally I'd evaluate the {!...} expression for its type and provide that to the XSD processor, but I'm not sure if that's going to be possible. I think there's a way that I can suppress that warning/error, though, so I'll keep this open for me to investigate that. Thanks for reporting!

  2. Log in to comment