Skip to content

Commit bda4993

Browse files
Filter fields in DynamicForm to only include those present in the field collection.
1 parent 60d1db9 commit bda4993

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/controls/dynamicForm/DynamicForm.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,9 @@ export class DynamicFormBase extends React.Component<
230230
<>
231231
<h2 className={styles.sectionTitle}>{section.displayname}</h2>
232232
<div className={styles.sectionFormFields}>
233-
{section.fields.map((f, i) => (
233+
{section.fields
234+
.filter(f => fieldCollection.find(fc => fc.label === f))
235+
.map((f, i) => (
234236
<div key={f} className={styles.sectionFormField}>
235237
{this.renderField(fieldCollection.find(fc => fc.label === f) as IDynamicFieldProps)}
236238
</div>

0 commit comments

Comments
 (0)