In Lightning, I have a pretty simple modal that I call from an action button on a detail page that includes a text area field:
<div class="slds-form-element">
<div class="slds-form-element__control">
<lightning:textarea label="Required" name="myText" required="true" messageWhenValueMissing="This field is required."
maxlength="1000" value="{!v.sAlertMessage}" placeholder="Enter Alert Details Here"/>
</div>
I then have two buttons - one for submit and one for cancel. The Cancel button just calls the hanldeCancel function in the component controller:
<lightning:button label="Cancel" onclick="{!c.handleCancel}" class="slds-m-top--medium" />
handleCancel: function(component, event, helper) {
$A.get("e.force:closeQuickAction").fire();
},
But when I click the button, I get the required field error. In VF land, I'd just use Immediate = TRUE to circumvent that, but I don't see any such option in LEX? Is there any equivalent to tell LEX to just close without validation?
The odd thing is when I click cancel a second time, it does close the modal...