-
-
Notifications
You must be signed in to change notification settings - Fork 363
feat(Select): add IsUseActiveWhenValueIsNull parameter #6304
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
Reviewer's GuideIntroduces a new IsUseActiveWhenValueIsNull parameter in the Select component, refactors the change handler to respect this parameter via a SetSelectedItemState helper, and adds a unit test to verify the new behavior. Sequence diagram for Select OnChange logic with IsUseActiveWhenValueIsNullsequenceDiagram
participant User as actor User
participant Select as Select<TValue>
participant Item as SelectedItem
User->>Select: Triggers OnChange(args)
alt Value is null
alt IsUseActiveWhenValueIsNull && !IsVirtualize
Select->>Select: SetSelectedItemState(GetItemByRows())
else
Select->>Select: return null
end
else Value is not null
Select->>Select: GetItemByVirtualized() or GetItemByRows()
Select->>Select: SetSelectedItemState(item)
end
Select-->>User: (state updated)
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
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.
Hey @ArgoZhang - I've reviewed your changes - here's some feedback:
- Consider renaming the
IsUseActiveWhenValueIsNullparameter to a more concise form (e.g.UseActiveItemOnNull) for readability and consistency with other bool flags. - Right now you only trigger the active‐item logic in the change handler—make sure the active item is also applied on initial render rather than waiting for a change event.
- Verify that the new active‐when‐null behavior is consistently applied in virtualized mode (e.g. in the
GetItemByVirtualizedcode path) if virtualize support is required.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider renaming the `IsUseActiveWhenValueIsNull` parameter to a more concise form (e.g. `UseActiveItemOnNull`) for readability and consistency with other bool flags.
- Right now you only trigger the active‐item logic in the change handler—make sure the active item is also applied on initial render rather than waiting for a change event.
- Verify that the new active‐when‐null behavior is consistently applied in virtualized mode (e.g. in the `GetItemByVirtualized` code path) if virtualize support is required.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6304 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 714 714
Lines 31446 31452 +6
Branches 4437 4438 +1
=========================================
+ Hits 31446 31452 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Link issues
fixes #6303
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Enable default selection of a pre-marked active item in the Select component when its Value is null by adding the IsUseActiveWhenValueIsNull parameter, updating the change handling logic, and validating the behavior with a new unit test.
New Features:
Enhancements:
Tests: