improvement(components): [select] improve emits type#24074
Conversation
|
Azure Pipelines: 1 pipeline(s) were filtered out due to trigger conditions. |
📝 WalkthroughWalkthrough
Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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: |
|
Size Change: -142 B (-0.01%) Total Size: 1.47 MB 📦 View Changed
ℹ️ View Unchanged
|
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||
|
🧪 Playground Preview: https://element-plus.run/?pr=24074 |
|
might be necessary to refactor it into a generic component to fully resolve the type error. |
|
Azure Pipelines: 1 pipeline(s) were filtered out due to trigger conditions. |
|
Azure Pipelines: 1 pipeline(s) were filtered out due to trigger conditions. |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/components/select/src/select.ts`:
- Around line 329-331: The emit validators for UPDATE_MODEL_EVENT and
CHANGE_EVENT currently use "SelectProps['modelValue'] | any" which collapses to
any; update these validators to the concrete emitted types instead — replace
"SelectProps['modelValue'] | any" with the actual payload types used in
useSelect.ts (e.g. OptionValue | OptionValue[] or the specific union/type
exported there) so the validators preserve type safety for emits; ensure the
validators reference the OptionValue type (or the exported type from useSelect)
and keep the validator signature (val: OptionValue | OptionValue[] ) => true for
both UPDATE_MODEL_EVENT and CHANGE_EVENT.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: bf614858-8a8b-40a1-afcb-bc3b3d53ff6b
📒 Files selected for processing (1)
packages/components/select/src/select.ts
|
@rzzf This PR has conflicts, please resolve them. |
|
@rzzf Thanks for your contribution! ❤️ |

Please make sure these boxes are checked before submitting your PR, thank you!
devbranch.Before
After
Removing
anyfrom theupdate:modelValueandchangeevents requires generic components, and the current change will not affect existing code.Summary by CodeRabbit