Fix returning correct custom value in SelectCustom component

This commit is contained in:
Ingo Oppermann 2024-06-04 14:55:46 +02:00
parent 88826db4fd
commit 8be8128d6e
No known key found for this signature in database
GPG Key ID: 2AB32426E9DD229E
2 changed files with 7 additions and 3 deletions

View File

@ -41,7 +41,11 @@ export default function Component(props) {
isCustom: v === props.customKey ? true : false,
});
props.onChange(event);
props.onChange({
target: {
value: v === props.customKey ? value.custom : value.value,
},
});
};
const handleCustomChange = (event) => {
@ -59,7 +63,7 @@ export default function Component(props) {
options.push(
<MenuItem key={o.value} value={o.value} disabled={o.disabled === true}>
{o.label}
</MenuItem>
</MenuItem>,
);
}

View File

@ -143,7 +143,7 @@ const Streams = function (props) {
{props.streams.map((stream, index) => (
<Grid key={stream.index + ':' + stream.stream} item xs={12}>
<Stack>
<Typography sx={{textTransform: "UPPERCASE", marginBottom: 2}} >{stream.type}</Typography>
<Typography sx={{ textTransform: 'UPPERCASE', marginBottom: 2 }}>{stream.type}</Typography>
<Stream stream={stream} onChange={handleChange(index)} />
</Stack>
</Grid>