Skip to content

fix(InputNumber): work uncontrolled with only a default value - #6859

Open
61021 wants to merge 1 commit into
nuxt:v4from
61021:fix/input-number-uncontrolled
Open

fix(InputNumber): work uncontrolled with only a default value#6859
61021 wants to merge 1 commit into
nuxt:v4from
61021:fix/input-number-uncontrolled

Conversation

@61021

@61021 61021 commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

🔗 Linked issue

Resolves #6857

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

The wrapper resolved defaultValue into a defined :model-value, so reka went controlled at setup and froze without a v-model. Dropped the defaultValue option from useVModel: reka already gets :default-value and handles uncontrolled state itself. Controlled usage and the optional modifier path are unchanged.

Input/Textarea share the pattern but their native inputs mask it, so this stays scoped to InputNumber.

New test drives the increment button without a v-model; red on v4 (the value stays frozen).

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@61021
61021 requested a review from benjamincanac as a code owner August 18, 2026 12:16
@github-actions github-actions Bot added the v4 #4488 label Aug 18, 2026
@coderabbitai

coderabbitai Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: d5ab3e15-c87e-4905-9135-e111996cb5ae

📥 Commits

Reviewing files that changed from the base of the PR and between a630c94 and 009eaa2.

📒 Files selected for processing (2)
  • src/runtime/components/InputNumber.vue
  • test/components/InputNumber.spec.ts

Included review availability: Your plan includes up to 8 reviews per rolling hour; 5 remain after this review.


📝 Walkthrough

Walkthrough

InputNumber no longer passes defaultValue as the internal useVModel default. NumberFieldRoot still receives defaultValue separately. A test now verifies that an uncontrolled value initialized to 5 increments to 6, emits update:modelValue, and updates the rendered input.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 009ea

The fix restores expected uncontrolled default-value behavior for InputNumber while preserving controlled usage; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The change removes the default fallback from useVModel, restores uncontrolled InputNumber behavior, and adds a regression test for issue #6857.
Out of Scope Changes check ✅ Passed The code and test changes are limited to the InputNumber uncontrolled default-value bug described in issue #6857.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly identifies the InputNumber bug fix for uncontrolled usage with only a default value.
Description check ✅ Passed The description explains the InputNumber bug, the implementation change, the regression test, and the preserved behaviors.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codspeed-hq

codspeed-hq Bot commented Aug 18, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing 61021:fix/input-number-uncontrolled (009eaa2) with v4 (a630c94)

Open in CodSpeed

@pkg-pr-new

pkg-pr-new Bot commented Aug 18, 2026

Copy link
Copy Markdown
npm i https://pkg.pr.new/@nuxt/ui@6859

commit: 009eaa2

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

Labels

v4 #4488

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InputNumber with default-value and no v-model is frozen

1 participant