I have a lightning-input-field
inside a lightning-record-edit-form
, used to create records. The field-name
is a picklist field which uses a Picklist Value Set, with one default value.
When the form is loaded, the initial field value is undefined
, but displays the default value. When the picklist is used to select another value, it is changed from undefined
to whatever was selected, as evidenced by the onchange
handler output.
I can use getObjectInfo
to @wire
the object info and resolve the default record type Id (or hardcode the default 012000000000000AAA
), then use that value to getPicklistValues
to @wire
the default value for the picklist which seems to initialize the value.
That seems like a lot of work to get the field value to properly reflect the displayed value. Are there simpler ways to get this functionality?