Skip to content

Fix decimal typing behavior for number inputs in tools form#1127

Merged
cliffhall merged 1 commit intomodelcontextprotocol:mainfrom
MumuTW:fix-tools-tab-decimal-input-1080
Mar 8, 2026
Merged

Fix decimal typing behavior for number inputs in tools form#1127
cliffhall merged 1 commit intomodelcontextprotocol:mainfrom
MumuTW:fix-tools-tab-decimal-input-1080

Conversation

@MumuTW
Copy link
Contributor

@MumuTW MumuTW commented Mar 6, 2026

Summary

  • preserve raw numeric input text while typing in DynamicJsonForm number/integer fields
  • avoid stripping intermediate decimal input like -74.0 caused by immediate numeric re-serialization
  • keep existing numeric validation and commit normalized values on blur
  • add regression test covering -74.0 -> -74.01 entry flow

Testing

  • cd client && npm test -- --runTestsByPath src/components/tests/DynamicJsonForm.test.tsx

Fixes #1080

Copy link
Member

@cliffhall cliffhall left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

Tested locally, verifying that the existing Inspector has the problem and that this PR fixes it.

@BobDickinson This fix also needs to be applied to the v1.5 core

@cliffhall cliffhall enabled auto-merge March 8, 2026 00:10
@cliffhall cliffhall merged commit 7c8b031 into modelcontextprotocol:main Mar 8, 2026
5 checks passed
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.

Input textbox validation error in tools tab

2 participants