Umbraco.CMS.Backoffice
Umbraco.CMS.Backoffice copied to clipboard
[BUG]: Decimal & Numeric property editor with "minimum" set to `0` allows negative values, `Maximum` set to `10` allows values above `10`
Describe the bug
On the Decimal
property editor, when Minimum
is set to 0
, a user can still set negative values. When the property's Maximum
is set to 10, a user can still set the value to 50
The same bug exists in both the Numeric
and Decimal
property editors.
To Reproduce Steps to reproduce the behavior:
- Fresh install the V14 RC
- Create a document type with a new Decimal property editor
- Configure its properties:
- Minimum: 0
- Maximum: 10
- Step Size: 0.01
- Allow Decimals: false
- Save the property & docype
- Create a new piece of content using the doctype
- Set the decimal value to
-50
(or any negative value) - Clicking save and publish incorrectly saves the document with
-50
, reloading the page returns-50
Note that the inverse behaviour also happens. The max value of 10 is also ignored, and I can enter 50
into the property.
Expected behavior
When minimum
is set to 0, the lowest value the property should accept is 0. Negative values should return a validation error on Save and publish.
Screenshots If applicable, add screenshots to help explain your problem.
Screenshot shows the property editor configuration on the left. The right shows content using that editor with invalid data.
Desktop (please complete the following information):
- OS: macOS Sonoma 14.2.1 (23C71)
- Browser MS Edge
- Version 122.0
Additional context Related to https://github.com/umbraco/Umbraco.CMS.Backoffice/issues/1660