0

Im trying from a long time to remove the Cancel button at the bottom for modal , but when I do it, it is also removing Done button. I would like to retain the Done. Can you please let me know what wrong I am doing. Here is the code and screen shot. FileuploadPopUp.cmp , Quick action on Account with FileuploadPopUp.cmp in quickAction

<aura:component description="FileUploadPopUp" implements="force:hasRecordId,force:lightningQuickAction" >
    <aura:attribute name="next" type="boolean" default="false" />
    <aura:attribute name="current" type="boolean" default="true" />
    <aura:html tag="style">             
        .slds-modal__container {
        min-width: 60vw;
        }
        .ui-widget{
            margin:0px !important;
        }        
        .slds-modal__content {
             min-height: 5vw !important;
        }
    </aura:html>
    <aura:if isTrue="{!v.current}">
        <lightning:button label="Next" title="Next" onclick="{!c.NextHs }" />
    </aura:if>
    <aura:if isTrue="{!v.next}">
    <c:FileUploadStandardPopUp />
    </aura:if>
</aura:component> 

({
    NextHs : function(component, event, helper) {
        component.set('v.next',true);
        component.set('v.current',false);
    }
})

FileUploadStandardPopUp.cmp

<aura:component >
    <aura:attribute name="POEID" type="string" default="0016g00000C5RPVAA3"/>
    <lightning:fileUpload  label="Upload Files" 
                          name="fileUploader"   
                          multiple="false"  
                          recordId="{!v.POEID}" 
                          onuploadfinished="{!c.handleUploadFinished}" />   
</aura:component>

({
    handleUploadFinished : function(component, event, helper) {

    }
})

I tried in the above style block , but it remove both cancel and done buttons.

.uiButton--brand{
        display:none;
        }

enter image description here

2 Answers 2

2

Why not target some other class which is not common in both for example in your aura:html tag you can put this

<aura:html tag="style"> 
.cuf-publisherCancelButton{
        display:none;
        }
 </aura:html>
2
  • Thanks much :) , I tried to do inspect element , but didn't find that. where to find it.
    – shaan
    Commented Apr 6, 2020 at 18:36
  • @shaan i guess you missed it, its there though
    – User6670
    Commented Apr 6, 2020 at 18:39
1

You should implement lightningQuickActionWithoutHeader to hide the cancel button

Example:

<aura:component description="FileUploadPopUp" implements="force:lightningQuickActionWithoutHeader, force:hasRecordId">
   <header class="slds-modal__header">
      <h2 class="slds-modal__title slds-hyphenate">Modal Header</h2>
   </header>

   <!-- Your code -->
</aura:component>
2
  • Anmol Kumar: Doing that will remove my header too. I need header, but not the footer. If I remove footer using css, the same issue it also disables footer for upload.
    – shaan
    Commented Apr 6, 2020 at 18:26
  • I have updated my answer to include a header in markup, as mentioned in the documentation if you are implementing force:lightningQuickActionWithoutHeader interface, you need to implement your own header/footer as required in Html itself. Commented Apr 6, 2020 at 18:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .