Repository navigation
fix(controls): keep the number input controlled before the arg has a value - #965
Merged
dannyhw merged 2 commits intoNov 14, 2026
Merged
Conversation
🦋 Changeset detectedLatest commit: c5eda84 The changes in this PR will be included in the next version bump. This PR includes changesets to release 9 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Author
Member
|
@Purv-Kabaria approved, thanks for the contribution :) |
dannyhw
approved these changes
Nov 11, 2026
Contributor
Author
|
Thanks for approving this, Danny! The Check everything! job is green now too. Happy to make any final adjustments if needed; appreciate you taking the time to review :) |
dannyhw
added a commit
that referenced
this pull request
Nov 14, 2026
Port the check/inline-check control (#972) and the number control fix (#965) to the built-in controls in packages/react-native/src/controls. Move the check control's PropField tests into @storybook/react-native, since PropField is no longer reachable from the addon-ondevice-controls stub, and retarget the check-control and number-control changesets to @storybook/react-native.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue: #957
What I did
NumberTypeseedsnumStrfromarg.value?.toString(), so when the panel renders before the story's args are set, the input mounts withvalue={undefined}(uncontrolled).useResyncValuethen sets a string and the input becomes controlled, which logs React's "changing an uncontrolled input to be controlled" warning on web. The input now falls back to'', as suggested in the issue. Added a patch changeset for@storybook/addon-ondevice-controls.How to test
args: { value: 5 }.NumberType. With it, there's no warning and the control still edits the arg.No new example or docs needed.