I am unsure of what I am missing here...
So I have a child component with an attribute:
<aura:attribute name="recordClosed" type="Boolean" />
In the component I am doing something like this:
<aura:iteration items="{!v.recordData}" var="recordField">
<aura:if isTrue="{!recordField.isDescription == false || (recordField.isDescription && v.recordClosed == false)}">
<lightning:layout>
<!--some html-->
</lightning:layout>
</aura:if>
</aura:iteration>
The problem is with recordClosed. In my parent, I pass in the value for recordClosed when I create the component.
Now, if I add {!v.recordClosed}
above the aura:if, it will print out 'false' on in my component. If I do {!v.recordClosed == false}, it will still spit out false... So my aura:if is failing when it should be true.
It says the value for recordField.isDescription
is true and recordClosed
is false, but the recordClosed
comparison fails. It even does it when it is true and compared to true.
I even tried using {!not(v.recordClosed)}
, it still fails to spit out true even though recordClosed is false.
{!and(recordField.isDescription, !v.recordClosed)}
, not sure if it does some kind of type check (which would be rather odd). Otherwise try with addingdefault="true"
to the attribute. If nothing works, kindly share minimal code for us to replicate the behavior.