Skip to content

[core] fix(NumericInput): infer precision from all step sizes - #8315

Open
sebxt wants to merge 1 commit into
palantir:developfrom
sebxt:fix/numericinput-step-precision
Open

sebxt wants to merge 1 commit into
palantir:developfrom
sebxt:fix/numericinput-step-precision

Conversation

@sebxt

@sebxt sebxt commented Oct 19, 2026

Copy link
Copy Markdown

Fixes #0000

Checklist

  • Includes tests
  • Update documentation

Changes proposed in this pull request:

NumericInput derived its rounding precision from minorStepSize alone whenever it was set, so a stepSize or majorStepSize with more decimal places was rounded away. For example <NumericInput stepSize={0.25} /> (default minorStepSize={0.1}) incremented to 0.3, 0.6, 0.9, and majorStepSize={2.5} with minorStepSize={null} incremented to 3.

getStepMaxPrecision now returns the largest decimal place count among the non null stepSize, minorStepSize and majorStepSize. Configurations where minorStepSize already had the most decimals behave exactly as before, and minorStepSize={null} with integer steps still limits the input to integers.

The "Numeric precision" docs section is updated to describe the new rule. Two tests cover the stepSize and majorStepSize cases; both fail on develop.

Reviewers should focus on:

Whether majorStepSize should be part of the rule. I included it because it has the same problem and the default (10) never adds precision.

Screenshot

N/A

Fixes #8314

@palantirtech

Copy link
Copy Markdown
Member

Thanks for your interest in palantir/blueprint, @auraseb! Before we can accept your pull request, you need to sign our contributor license agreement - just visit https://cla.palantir.com/ and follow the instructions. Once you sign, I'll automatically update this pull request.

@changelog-app

changelog-app Bot commented Oct 19, 2026

Copy link
Copy Markdown

Generate changelog in packages/core/changelog/@unreleased

Type (Select exactly one)

  • Feature (Adding new functionality)
  • Improvement (Improving existing functionality)
  • Fix (Fixing an issue with existing functionality)
  • Break (Creating a new major version by breaking public APIs)
  • Deprecation (Removing functionality in a non-breaking way)
  • Migration (Automatically moving data/functionality to a new system)

Description

[core] fix(NumericInput): infer precision from all step sizes

Check the box to generate changelog(s)

  • Generate changelog entry

Signed-off-by: Sebastian Turner <sebastiant3484@gmail.com>
@sebxt
sebxt force-pushed the fix/numericinput-step-precision branch from a03f776 to 1f695aa Compare October 20, 2026 23:26

This branch has not been deployed

No deployments
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.

NumericInput rounds stepSize increments when minorStepSize has fewer decimal places

2 participants