I am trying to expand and collapse a dropdown section. On Click of button, I am calling a new page and also expanding the section. While I write a condition for collapse, it does not work. I feel my approach is not accurate. Kindly help.


[<aura:if isTrue="{!v.isShowDRopDown }">
    <lightning:layout >
        <lightning:layoutItem  class="tabFixWidth" >
            <lightning:layoutItem  >
                <lightning:button  aura:id="fAQ" label="faq" onclick="{!c.getKnowledgeFAQData}" class="cstm-subbutton1 cstm-act-subtab">
                    <aura:if isTrue="{!v.isShowText}">
                        <lightning:formattedText value="FAQ &amp; How-To" class="slds-p-around_x-small"/>
                    <aura:if isTrue="{!v.sActiveSubTab=='fAQ'}">
                        <img src="{!$Resource.LR_Portal_Resources +'/pointer.svg'}" class="cstm-tee"/> <!--White-->
                </lightning:button> ]


[ if(withoutLastChunk == 'knowledge'){
     component.set("v.isShowKowledge", true);
     component.set("v.sActiveTab", 'Knowledge');
     component.set("v.isShowDRopDown", true);
     component.set("v.sActiveSubTab", 'fAQ');
     component.set("v.customKnowledge", 'cstm-act');
  getKnowledgeFAQData : function(component, event, helper) {
     helper.navigationHelper(component, event, helper, 'knowledge');

1 Answer 1


First and foremost, is this copied from your actual source code? Because if so, the first place you should be looking is at your variables and their names' spelling and casing.

For example, v.isShowKowledge and v.isShowDRopDown. Unless you also made the same typo/casing-weirdness in your component's attribute names, I'd be looking there first.

  • Thanks for responding. Yes this is from the actual source where it is implemented. Jun 9, 2022 at 6:12
  • Ok, then I'd definitely verify that the reference in your aura:if and controller match exactly the attritube name of your component boolean - they're case-sensitive. So, if your Aura:If and controller have it as "isShowDRopDown", but your attribute is actually "isShowDropDown", it's not going to work. But it also won't throw an obvious error. It just won't work. Jun 10, 2022 at 18:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.