Fix updating value with "," instead of "." in reccomended mode

Fixed by correctly parsing dot in `SingleSettingTextField`.

CURA-9793
This commit is contained in:
c.lamboo 2022-12-13 11:46:06 +01:00
parent 8117087664
commit 564fefa1c7

View file

@ -87,15 +87,17 @@ UM.TextField
function parseValueUpdateSetting() function parseValueUpdateSetting()
{ {
if (propertyProvider.properties.value === text || (parseFloat(propertyProvider.properties.value) === parseFloat(text))) // User convenience. We use dots for decimal values
const modified_text = text.replace(",", ".");
if (propertyProvider.properties.value === modified_text || (parseFloat(propertyProvider.properties.value) === parseFloat(modified_text)))
{ {
// Don't set the property value from the control. It already has the same value // Don't set the property value from the control. It already has the same value
return return
} }
if (propertyProvider && text !== propertyProvider.properties.value) if (propertyProvider && modified_text !== propertyProvider.properties.value)
{ {
updateSetting(text); updateSetting(modified_text);
} }
} }