diff --git a/CHANGELOG.md b/CHANGELOG.md index bf2c2c2821..ce08f95814 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ - [Fixed files associations not properly registered on Windows][11030] - [Fixed "rename project" button being broken after not changing project name][11103] +- [Numbers starting with dot (`.5`) are accepted in Numeric Widget][11108] [10774]: https://github.com/enso-org/enso/pull/10774 [10814]: https://github.com/enso-org/enso/pull/10814 @@ -31,6 +32,7 @@ [11014]: https://github.com/enso-org/enso/pull/11014 [11030]: https://github.com/enso-org/enso/pull/11030 [11103]: https://github.com/enso-org/enso/pull/11103 +[11108]: https://github.com/enso-org/enso/pull/11108 #### Enso Standard Library diff --git a/app/gui2/src/components/widgets/NumericInputWidget.vue b/app/gui2/src/components/widgets/NumericInputWidget.vue index 82abc9cac4..9d71ce65cc 100644 --- a/app/gui2/src/components/widgets/NumericInputWidget.vue +++ b/app/gui2/src/components/widgets/NumericInputWidget.vue @@ -28,6 +28,8 @@ const lastValidValue = ref() watch(editedValue, (newValue) => { if (newValue == '' || isNumericLiteral(newValue)) { lastValidValue.value = newValue + } else if (isNumericLiteral('0' + newValue)) { + lastValidValue.value = '0' + newValue } }) const valueString = computed(() => (props.modelValue != null ? props.modelValue.toString() : ''))