refactor(components): [autocomplete] use type-based definitions#23410
Conversation
📝 WalkthroughWalkthroughRefactors Autocomplete and Input public prop APIs: introduces Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 |
commit: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@packages/components/autocomplete/src/autocomplete.ts`:
- Around line 35-104: The AutocompleteProps interface narrows modelValue to
string | number which conflicts with InputProps (allowing null/undefined) and
breaks consumers/tests; update AutocompleteProps to inherit the same modelValue
type as InputProps (do not re-declare or, if re-declaring, use
InputProps['modelValue']) so modelValue remains nullable/optional; locate the
modelValue declaration in AutocompleteProps and replace the narrowed type with
the original InputProps type (or remove the override) to match the
implementation that already handles null via the ?? '' usage.
|
🧪 Playground Preview: https://element-plus.run/?pr=23410 |
|
Hello @rzzf , the refactoring of the |
rzzf
left a comment
There was a problem hiding this comment.
Thank you for your quick response.
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/components/input/src/input.vue (1)
205-219: Missing default values ininputPropsDefaults— this will cause regressions.The
inputPropsDefaultsexport is incomplete. It omits several defaults from the original inline configuration, most notablyautosize: false. Wheninput.vuespreadsinputPropsDefaultsintowithDefaults(), these properties will lose their default values:
autosize: false(behavioral default — important)containerRole: undefinedinputmode: undefinedid: undefinedAdd these missing defaults to
inputPropsDefaultsbefore the refactoring can be merged.
Co-authored-by: rzzf <[email protected]>
rzzf
left a comment
There was a problem hiding this comment.
Thanks for all the back-and-forth
Happy to contribute |
|
@E66Crisp Thanks for your contribution! ❤️ |

Please make sure these boxes are checked before submitting your PR, thank you!
devbranch.rel #23399
Summary by CodeRabbit
New Features
Refactor
Chores
✏️ Tip: You can customize this high-level summary in your review settings.