Skip to content

fix(vue-vuetify): decouple NumberControl precision from step (fixes #2523)#2601

Open
darius-lesch wants to merge 2 commits into
eclipsesource:masterfrom
darius-lesch:fix/default-precision-for-vue-vuetify-number-control-renderer
Open

fix(vue-vuetify): decouple NumberControl precision from step (fixes #2523)#2601
darius-lesch wants to merge 2 commits into
eclipsesource:masterfrom
darius-lesch:fix/default-precision-for-vue-vuetify-number-control-renderer

Conversation

@darius-lesch

Copy link
Copy Markdown

Description

This PR resolves #2523 regarding the default precision limitation in the Vue-Vuetify NumberControlRenderer.

The Problem:
Previously, the precision computed property artificially restricted decimal places by tying them to the length of the step property (which defaults to 0.1). Furthermore, when step was an integer, it returned undefined, which did not lift the restriction in Vuetify (Vuetify's VNumberInput requires null to allow infinite precision). This prevented users from typing standard decimal values.

The Solution:

  • Decoupled precision from step.
  • The control now returns null by default, allowing the native Vuetify input to accept unlimited decimal places.
  • If a developer explicitly provides an options.precision property via the UI Schema, that specific configuration is now respected and passed to the input.

Motivation and Context

Allows the NumberControl to behave naturally like a standard numeric input without abruptly truncating user data, while still allowing developers to restrict precision if they explicitly configure it in the UI Schema.

How Has This Been Tested?

  • Added unit test asserting that precision resolves to null by default.
  • Added unit test asserting that options.precision is correctly passed through to the VNumberInput.
  • Updated the existing snapshot (the default value 1.0 correctly reverted to 1 as artificial precision formatting was removed).
  • Tested manually in a downstream Vue 3 + Vite application.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Decouple `precision` property in `NumberControlRenderer.vue` from `step` value. Default it to pass `null` to `v-number-input` to allow infinite decimal places instead of locking it to 1 decimal place. Enforce limits only if explicitly provided in `options.precision` via the UI Schema. Includes unit tests for these fixes.
…ber-control-7174124808551499029

Fix Default Precision for NumberControlRenderer
@netlify

netlify Bot commented Jul 16, 2026

Copy link
Copy Markdown

Deploy Preview for jsonforms-examples ready!

Name Link
🔨 Latest commit 61cd894
🔍 Latest deploy log https://app.netlify.com/projects/jsonforms-examples/deploys/6a592e6dffdf860008ff60c0
😎 Deploy Preview https://deploy-preview-2601--jsonforms-examples.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@CLAassistant

CLAassistant commented Jul 16, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[vue-vuetify] Wrong default precision for NumberControl

2 participants