4

Brief:

I have a container component that overrides the View Action of a custom object in Lightning Experience.

The container component contains a component that renders a list of related records and a button. The button triggers the dynamic creation of a modal component and its' content which is a lightning:recordEditForm component.

Issues:

  1. Using MS Edge the lightning:recordEditForm is usually not generated and rendered.
  2. In the rare occasion that it does get generated and rendered, when submitting the form, the record is created but the onSuccess handler is not triggered.

(I can not replicate the two issues using Chrome.)

Simplified Reproducible Case

parent.cmp

<aura:component implements="lightning:actionOverride, force:hasRecordId">
  <success:testRecordEditForm />
</aura:component>

testRecordEditForm.cmp

<aura:component>
  <div aura:id="formContainer"></div>
  <lightning:button label="Show Form" onclick="{! c.showForm }"/>
  <lightning:button label="Submit Form" onclick="{! c.submitForm }"/>
</aura:component>

testRecordEditFormController.cmp

({
  showForm : function (component) {

    $A.createComponent('success:sampleRecordEditForm', { 
      'aura:id' : 'editForm',
      'recordId' : undefined
    }, function(content, status) {
      if(status === 'SUCCESS') {
        component.find('formContainer').set('v.body', content);
      }
    });
  },

  submitForm : function (component) {

    component.find('editForm').save();
  }
})

sampleRecordEditForm.cmp

<aura:component>
  <aura:attribute name="recordId" type="String" />

  <aura:method name="save" action="{!c.save}" />

  <lightning:recordEditForm 
    aura:id="recordEditForm" 
    recordId="{!v.recordId}" 
    objectApiName="Contact" 
    onsuccess="{!c.handleSuccess}">
      <lightning:messages />
      <lightning:inputField fieldName="LastName" />
      <lightning:inputField fieldName="Description" />
  </lightning:recordEditForm>
</aura:component>

sampleRecordEditFormController.cmp

({
  handleSuccess : function() { //NOT BEING EXECUTED

    alert('SUCCESS');
  },

  save : function(component) {

    component.find('recordEditForm').submit();
  }
})

(all components tested in API Version 42.0 and 43.0)

This looks like a platform bug, Has anybody come across this issue?

  • 1
    Sounds like a real edge case – Caspar Harmer Jun 28 '18 at 21:09

Your Answer

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

Browse other questions tagged or ask your own question.