changes rendering of enums

This commit is contained in:
Mose Müller 2024-03-04 11:48:01 +01:00
parent 853472be94
commit af36ed6c43

View File

@ -73,7 +73,7 @@ export const EnumComponent = React.memo((props: EnumComponentProps) => {
{readOnly ? ( {readOnly ? (
// Display the Form.Control when readOnly is true // Display the Form.Control when readOnly is true
<Form.Control value={enumValue} name={name} disabled={true} /> <Form.Control value={enumDict[enumValue]} name={name} disabled={true} />
) : ( ) : (
// Display the Form.Select when readOnly is false // Display the Form.Select when readOnly is false
<Form.Select <Form.Select
@ -83,7 +83,7 @@ export const EnumComponent = React.memo((props: EnumComponentProps) => {
onChange={(event) => changeCallback(event.target.value)}> onChange={(event) => changeCallback(event.target.value)}>
{Object.entries(enumDict).map(([key, val]) => ( {Object.entries(enumDict).map(([key, val]) => (
<option key={key} value={key}> <option key={key} value={key}>
{key} - {val} {val}
</option> </option>
))} ))}
</Form.Select> </Form.Select>