use numberValue() to prevent web errors with integers

This commit is contained in:
proddy
2024-09-01 12:29:23 +02:00
parent 1d45a08668
commit 94d1aa56b1
4 changed files with 18 additions and 23 deletions

View File

@@ -203,7 +203,7 @@ const CustomEntitiesDialog = ({
margin="normal"
sx={{ width: '11ch' }}
type="number"
value={editItem.offset}
value={numberValue(editItem.offset)}
onChange={updateFormValue}
/>
</Grid>
@@ -288,21 +288,16 @@ const CustomEntitiesDialog = ({
{editItem.value_type === DeviceValueType.STRING &&
editItem.device_id !== '0' && (
<Grid>
<TextField
<ValidatedTextField
fieldErrors={fieldErrors}
name="factor"
label="Bytes"
value={editItem.factor}
value={numberValue(editItem.factor)}
sx={{ width: '11ch' }}
variant="outlined"
onChange={updateFormValue}
margin="normal"
type="number"
slotProps={{
htmlInput: {
min: '1',
max: String(256 - editItem.offset),
step: '1'
}
}}
/>
</Grid>
)}