
Hello,
First time poster here. I am working on being a salesforce developer and have an issue with a Lightning component that I am hoping someone can help me out with. We create the component with the Warning Alert (Toast) and it works fine. However, when a user goes to use the Global Action button for a New Case and expands that box - the Lightning Component alert does not go to the background - it stays in the foreground. How can I resolve this? I tried to google and couldn't really find anything that made sense.
Here is the component Code:
<aura:component controller="PFG_MatchingCaseListCTRL" implements="force:hasRecordId,flexipage:availableForAllPageTypes" access="global">
<aura:handler name="init" value="{!this}" action="{!c.init}"/>
<aura:attribute name="cases" type="List" default="[]"/>
<!-- attributes -->
<aura:attribute name="data" type="Object"/>
<aura:attribute name="columns" type="List"/>
<aura:attribute name="selectedRowsCount" type="Integer" default="0"/>
<aura:attribute name="selectedRowsDetails" type="Object"/>
<aura:attribute name="selectedRowsList" type="List"/>
<aura:attribute name="maxRowSelection" type="Integer" default="5"/>
<aura:attribute name="rowList" type="String"/>
<aura:attribute name="rowCount" type="Integer" default="0"/>
<aura:attribute name="selectedRows" type="List"/>
<aura:renderIf isTrue="{!v.rowCount > 0}">
<div class="slds-box slds-box_small" style="background-color: white;">
<div class="slds-notify_container slds-is-relative">
<div class="slds-notify slds-notify_toast slds-theme_warning" role="status">
<span class="slds-assistive-text">warning</span>
<lightning:icon iconName="utility:warning" alternativeText="Warning!" variant="warning"/>
<div class="slds-notify__content slds-align_absolute-center" style="height 5rem;">
<h2 class="slds-text-heading_small " >DUPLICATE CASES WERE FOUND!</h2>
</div>
</div>
</div>
<!-- creating an action button -->
<div class="input-group">
<lightning:button variant="brand" label="No Action Needed" title="Brand Action" onclick="{!c.handleSelect}" />
</div>
<lightning:datatable
columns="{!v.columns}"
data="{!v.cases}"
keyField="Id"
selectedRows="{!v.selectedRows}"
maxRowSelection="{!v.maxRowSelection}"
onrowselection="{!c.updateSelectedText}"
hideCheckboxColumn="false"
/>
</div>
</aura:renderIf>
</aura:component>
This is because of the zindex property of the elements' css, that specifies the vertical stacking. In this case the toasts zindex is higher than the case create popout. In general with toast notifications, you want it to be the highest element. If this is not dismissable, you probably want the slds-notify_alert element instead https://www.lightningdesignsystem.com/components/alert/#site-main-content