0

I'm building a LWC app that allows the user to select records to edit. The records are displayed using a record-edit-form.

When switching between records, the input-field that renders my rich text field doesn't update its value like the other input-fields. It will show the last value and will intermittently update to the correct value.

I've tried using the reset function on the fields as described in the documentation, but that doesn't seem to help. Anyone have any luck using this component in this way? My next step is to skip using the record-edit-form and taking control of more of the load/saving logic but I'd rather not.

EDIT: I'm using the field as follows:

<lightning-record-edit-form
            record-id={recordId}
            object-api-name={goalObject}
            density="compact"
            layout-type="Full"
            mode={mode}
            record-type-id={recordTypeId}
            onsuccess={handleSaveSuccess} />
<lightning-layout multiple-rows>
   <lightning-layout-item size="12">
   <lightning-input-field variant="label-stacked" field-name="Overview__c" 
      class="overview-field">
   </lightning-input-field>
</lightning-layout-item>

<lightning-layout-item size="12" class="bottom-buttons-right" >
   <lightning-button
      class="slds-m-top_small"
      variant="brand"
      type="submit"
      name="update"
      label="Save"
      onclick={handleSaveClick}>
   </lightning-button>
  </lightning-layout-item>
</lightning-layout>                        
</lightning-record-edit-form>

I've noticed that if I click into the rich-text-field or .focus() on the element that this is causing the proper value to show sometimes. Still getting intermittent results.

  • Can you add code snippet? or minimum viable code to reproduce? – Pranay Jaiswal Sep 17 at 17:56
0

For the time being, I replaced the input-field with a input-rich-text and handled the loading & saving of the data separate from the record-edit-form saving the rest of my data.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.