Skip to content

Commit

Permalink
Allow numbers starting with dot in WidgetNumber (#11108)
Browse files Browse the repository at this point in the history
[Screencast from 2024-09-17 13-20-40.webm](https://github.com/user-attachments/assets/561adebb-7d93-4939-9dde-5453d5f304be)

(cherry picked from commit 5725e24)
  • Loading branch information
farmaazon authored and jdunkerley committed Sep 17, 2024
1 parent 0857604 commit 5c4fe1b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down
2 changes: 2 additions & 0 deletions app/gui2/src/components/widgets/NumericInputWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ const lastValidValue = ref<string>()
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() : ''))
Expand Down

0 comments on commit 5c4fe1b

Please sign in to comment.