-
Notifications
You must be signed in to change notification settings - Fork 7.8k
fix: vbenTree disabled supported #6211
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
Conversation
|
WalkthroughThe update refactors the tree component to consistently reference prop values via the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Tree
participant TreeItem
participant Checkbox
User->>Tree: Interact (select/click)
Tree->>TreeItem: Forward event
TreeItem->>Tree: Check props.disabled or item.disabled
alt Tree or item is disabled
TreeItem-->>User: No action
else
TreeItem->>Checkbox: Update checked state
Checkbox-->>TreeItem: Emit checked event
TreeItem->>Tree: Emit select event
end
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/@core/ui-kit/shadcn-ui/src/ui/tree/tree.vue (1)
270-270
: Inconsistent props referenceWhile the change correctly handles disabled state for checkboxes, there's an inconsistency in how the disabled prop is accessed compared to other locations.
- :disabled="disabled || get(item.value, 'disabled')" + :disabled="props.disabled || get(item.value, 'disabled')"
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
packages/@core/ui-kit/shadcn-ui/src/ui/tree/tree.vue
(4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (5)
- GitHub Check: post-update (windows-latest)
- GitHub Check: post-update (ubuntu-latest)
- GitHub Check: Check (windows-latest)
- GitHub Check: Test (windows-latest)
- GitHub Check: Lint (windows-latest)
🔇 Additional comments (3)
packages/@core/ui-kit/shadcn-ui/src/ui/tree/tree.vue (3)
195-197
: Good improvement in props reference clarity!The changes make it more explicit that these values are coming from the props object, which improves code clarity and helps prevent variable shadowing issues.
232-236
: Proper disabled state handling in selection eventThis change correctly prevents selection when either the entire tree or the specific item is disabled, improving accessibility and user experience.
282-284
: Good early return for disabled itemsAdding an early return prevents click handlers from running when items are disabled, properly implementing the disabled state behavior.
完善 vbenTree 对disabled属性的支持
Summary by CodeRabbit