mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-04-24 10:00:03 +02:00
changes rendering of enums
This commit is contained in:
parent
853472be94
commit
af36ed6c43
@ -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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user