-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support decimal numbers in editor #1051
Comments
The problem is here: const TypedInput = compose(
connect(null, {
showCustomAlert,
}),
getTypesService,
mapProps(
({
safeConvertValue,
types,
isAllowedValue,
valueType,
onChange,
showCustomAlert,
...props
}) => {
valueType = (typeof valueType === 'string' ? types[valueType] : valueType) || {
name: 'unknown',
};
const onChangeConvert = newValue =>
onChange && onChange(safeConvertValue(newValue, valueType));
const valueTypeName = valueType.name || valueType.base;
return {
allowedValues: valueType.allowedValues,
onChange: onChangeConvert,
valueType,
valueTypeName,
types,
...props,
};
},
),
)(InputWithIcon); The safeConvertValue is reseting the number when we add the dot. |
I think it makes sense to use the onBlur, but it might break behavior somewhere else (as it's typedInput), maybe add if valueType === 'number' and newValue end with "." add zero. (inside safeConvertValue) |
Tweek editor doesn't support decimal values only through the Source tab
The text was updated successfully, but these errors were encountered: