-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
fix(v-model): number modifier should update input value #13959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughExtends vModel change-event handling to apply number casting (in addition to trim), aligning change-driven normalization with input-driven normalization. Tests updated to dispatch a change event and assert the input’s displayed value is reformatted (e.g., "+01.2" → "1.2") after change. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User
participant I as Input (v-model.number)
participant D as vModel Directive
participant M as Model
participant V as View/DOM
rect rgb(250,250,255)
note over U,I: Typing (input event)
U->>I: type "+01.2"
I-->>D: input event
D->>D: normalize (cast to number)
D->>M: update modelValue (1.2)
D->>V: reflect value if needed
end
rect rgb(245,255,245)
note over U,I: Commit (change/blur)
U->>I: blur / change
I-->>D: change event
D->>D: normalize (trim and/or cast to number)
D->>M: assign normalized value
D->>V: set input.value to normalized string "1.2"
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
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. Comment |
Size ReportBundles
Usages
|
@vue/compiler-core
@vue/compiler-dom
@vue/compiler-sfc
@vue/compiler-ssr
@vue/reactivity
@vue/runtime-core
@vue/runtime-dom
@vue/server-renderer
@vue/shared
vue
@vue/compat
commit: |
fix #13958
Summary by CodeRabbit
Bug Fixes
Tests