Skip to content

Decimal umb-property-editor-ui-number fixes#18233

Merged
leekelleher merged 4 commits intov15/devfrom
v15/bugfix/numeric-input-value
Feb 5, 2025
Merged

Decimal umb-property-editor-ui-number fixes#18233
leekelleher merged 4 commits intov15/devfrom
v15/bugfix/numeric-input-value

Conversation

@leekelleher
Copy link
Member

Description

Fixes #18150.

Issue #18150 outlines several problems with the Number input when configured for use with the Decimal property-editor.

Changes in this PR:

  • Renamed #parseInt function to #parseNumber, it's a private function, renamed for readability.
  • Changed from using the @input to @change event for updating the property value.
  • Relaxed always setting an empty value (e.g. '') to 0, as the empty value may be intentional.
  • Fixed up invalid HTML, e.g. we had max="Infinity", when omitting the attribute is preferred.
  • Added step configuration for the Decimal data-type configuration, meaning that decimal places can be entered for minimum/maximum configuration.

There is one outstanding issue which will need to be resolved in the UUI library, re: umbraco/Umbraco.UI#1004

How to test?

Try configuring a Decimal data-type/property-editor and using it with various decimal/integer values.

Copy link
Contributor

@AndyButland AndyButland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me and I've had a play around and find it works much more as expected now. The only issue I could find is I assume similar to the one you've raised on the UI library:

  • Have a value already entered in the input field.
  • Select all and type a new value starting with a . or - - both valid characters for a decimal.
  • I find I have to type it twice, the first time the character input is discarded.

If you agree that's covered in the other issue, happy to merge this one in and close the one raised in this repository.

@leekelleher leekelleher merged commit 664d68e into v15/dev Feb 5, 2025
30 checks passed
@leekelleher leekelleher deleted the v15/bugfix/numeric-input-value branch February 5, 2025 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to enter decimal values into certain properties, including Umb.PropertyEditorUi.Decimal.

2 participants