Umbraco.CMS.Backoffice icon indicating copy to clipboard operation
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`

Open liamlaverty opened this issue 10 months ago • 0 comments

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:

  1. Fresh install the V14 RC
  2. Create a document type with a new Decimal property editor
  3. Configure its properties:
  • Minimum: 0
  • Maximum: 10
  • Step Size: 0.01
  • Allow Decimals: false
  1. Save the property & docype
  2. Create a new piece of content using the doctype
  3. Set the decimal value to -50 (or any negative value)
  4. 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.

Screenshot 2024-04-18 at 14 23 14

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

liamlaverty avatar Apr 18 '24 13:04 liamlaverty