1

I have the exact same code in production and sandbox. Things look as expected in sandbox, but in production I can see different css being applied. In Production the lightning input field is being rendered with a class of slds-form-element_horizontal. That class isn't applied in Sanboxes though.

<template>
    <lightning-record-edit-form record-id={contactId} object-api-name="Contact">

        <div class="slds-grid">
            <div class="slds-col slds-size_2-of-12"></div>

            <div class="slds-col slds-size_3-of-12">
                <lightning-input-field disabled field-name="FirstName">
                </lightning-input-field>
            </div>
            <div class="slds-col slds-size_3-of-12">
                <lightning-input-field disabled field-name="LastName">
                </lightning-input-field>
            </div>
            <div class="slds-col slds-size_4-of-12">
            </div>
        </div>


    </lightning-record-edit-form>
</template>
6
  • is your sandbox on the same version as your production? Are your APEX Classes set up to use the most recent API version?
    – gNerb
    Commented Nov 15, 2019 at 21:25
  • where is yout lightning web component being used? Commented Nov 15, 2019 at 21:48
  • is this communities? Commented Nov 19, 2019 at 17:30
  • API version 47.0 on production and sandboxes. No Apex involved. I made a simple test with this as a record detail.
    – gneek
    Commented Nov 19, 2019 at 17:31
  • @gneek where is this being used?Are you adding this component in another parent lightning component?
    – devforce
    Commented Nov 19, 2019 at 17:32

1 Answer 1

2

Figured it out! I had to adjust my Display Density setting to Comfy. And now I see I can override that in code.
density=comfy on lightning-record-edit-form.

<lightning-record-edit-form density="comfy" record-id={contactId} object-api-name="Contact">

https://developer.salesforce.com/docs/component-library/documentation/lwc/lwc.data_display_density

You must log in to answer this question.

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