function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Tyler DahleTyler Dahle 

Expanding and collapsing lightning:tab content?

<aura:component >
    <aura:attribute name="opts" type="List" default="['Tyler Dahle','Molly Demouser','Penny Demouser', 'Ted Demouser']"/>
	<lightning:tabset aura:id="tabBar" variant="scoped" selectedTabId="none">
    	<lightning:tab aura:id="ownerTab">
        	<aura:set attribute="label">
                <lightning:icon iconName="utility:groups"/>
            </aura:set>
            <div aura:id="userTabWrapper">
            <lightning:select name="users" label="Select Users/Groups/Resources:">
            	<aura:iteration items="{!v.opts}" var="option">
                	<option>{!option}</option>
                </aura:iteration>
            </lightning:select>
            <lightning:input type="checkbox" label="Enable" name="Enable User Filter" checked="true"/>
            <lightning:button class="closeUser" variant="base" iconName="utility:close" onclick="{!c.closeTabContent}"/>
            </div>
        </lightning:tab>
</lightning:tabset>
</aura:component>
Above is my general tabset structure (I have multiple tabs that look exactly the same with same information). I am just trying to get the content to be expandable and collapsible right now. It comes out of the box where content expands when you click the tab, but after you click you can't hide the content... I am having trouble grabbing the entire content box and hiding it. My controller for the close button is:
 
({
	closeTabContent : function(component, event, helper) {
        var tab_bar = component.find('tabBar');
        var tab = component.find("userTabWrapper");
        $A.util.removeClass(tab, "slds-is-expanded");
        $A.util.addClass(tab, "slds-is-collapsed");
	}
})

All this ends up doing is hiding the elements inside the content, which sounds good, but it still leaves the content box up, albeit smaller.... How do I go about collapsing the ENTIRE content box of the lightning:tab?

Thank you for any help!