Skip to content

fix(model-selector): scroll to selected model when reopening selector#177

Open
yefu24324 wants to merge 1 commit into
vuepont:mainfrom
yefu24324:bugfix/model-selector
Open

fix(model-selector): scroll to selected model when reopening selector#177
yefu24324 wants to merge 1 commit into
vuepont:mainfrom
yefu24324:bugfix/model-selector

Conversation

@yefu24324

@yefu24324 yefu24324 commented Jun 6, 2026

Copy link
Copy Markdown
企业微信截图_1780762242854

Summary by CodeRabbit

  • Refactor
    • Improved model selector component's data binding with enhanced type safety for more reliable two-way value synchronization.

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 29ea194f-6f56-4d54-9a6e-13d405202229

📥 Commits

Reviewing files that changed from the base of the PR and between 644eb78 and ee2d2a4.

📒 Files selected for processing (1)
  • packages/elements/src/model-selector/ModelSelectorContent.vue

📝 Walkthrough

Walkthrough

ModelSelectorContent.vue is refactored to use Vue's defineModel API, introducing a typed v-model binding. The AcceptableValue type is imported and the model is declared to accept either a single value or an array. The Command component template is updated to bind via v-model="value".

Changes

ModelSelectorContent v-model Integration

Layer / File(s) Summary
Typed v-model definition and binding
packages/elements/src/model-selector/ModelSelectorContent.vue
Component imports AcceptableValue type and defines a typed value model via defineModel<AcceptableValue | AcceptableValue[]>(). The Command element is updated to bind via v-model="value" for two-way data synchronization.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A model binding, typed and true,
Syncs the selector's value through,
AcceptableValue takes the stage,
DefineModel marks the age,
Vue's two-way dance, now in its place!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title describes scrolling to a selected model when reopening the selector, but the actual changes implement v-model binding to the Command component without any scroll-related functionality. Update the title to reflect the actual change, such as 'fix(model-selector): add v-model binding to ModelSelectorContent' or verify the implementation includes the scroll behavior described in the title.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 and usage tips.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant