Skip to content

Commit

Permalink
Fix element custom options
Browse files Browse the repository at this point in the history
  • Loading branch information
mikhail-vl committed Jan 10, 2024
1 parent 345e4c8 commit 963be05
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
- Add support for file base64 encoding in payload (#331)
- Add Context parameter to Payload (#331)

### Bugfixes

- Fix element custom options source ()

## 3.5.0 (2023-01-04)

### Features / Enhancements
Expand Down
33 changes: 16 additions & 17 deletions src/components/ElementEditor/ElementEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -547,23 +547,22 @@ export const ElementEditor: React.FC<Props> = ({
/>
</Field>
)}
{element.optionsSource === OptionsSource.CUSTOM ||
(!element.optionsSource && (
<div className={styles.optionsContainer} data-testid={TEST_IDS.formElementsEditor.options}>
<ElementOptionsEditor
options={element.options}
onChange={(options) =>
onChange({
...element,
options,
})
}
onChangeItem={(updated, original, checkConflict) => {
return onChangeOption(element, updated, original, checkConflict);
}}
/>
</div>
))}
{(element.optionsSource === OptionsSource.CUSTOM || !element.optionsSource) && (
<div className={styles.optionsContainer} data-testid={TEST_IDS.formElementsEditor.options}>
<ElementOptionsEditor
options={element.options}
onChange={(options) =>
onChange({
...element,
options,
})
}
onChangeItem={(updated, original, checkConflict) => {
return onChangeOption(element, updated, original, checkConflict);
}}
/>
</div>
)}
</>
)}

Expand Down

0 comments on commit 963be05

Please sign in to comment.