-
-
Notifications
You must be signed in to change notification settings - Fork 235
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
Fix select item issues in auto mode of BitNav (#10192) #10193
Fix select item issues in auto mode of BitNav (#10192) #10193
Conversation
WalkthroughThe pull request updates the BitNav component. The method signature for Changes
Sequence Diagram(s)sequenceDiagram
participant N as Navigation Handler
participant B as BitNav Component
N->>B: Trigger update by current URL
B->>B: Execute SetSelectedItemByCurrentUrl()
B->>B: Call SetSelectedItem(TItem? item)
B-->>N: Return updated selection state
Poem
✨ 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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
src/BlazorUI/Bit.BlazorUI/Components/Navs/Nav/BitNav.razor.cs (1)
890-890
: Fixed routing issue by using SetSelectedItemThis change properly updates
SetSelectedItemByCurrentUrl
to call the revisedSetSelectedItem
method instead of directly manipulating state. This ensures consistent behavior when selecting items, especially when no matching item is found.Since this is an async call, consider refactoring this method to be async and properly await the call rather than discarding the task with
_
.- _ = SetSelectedItem(currentItem); + await SetSelectedItem(currentItem);You would also need to update the method signature:
- private void SetSelectedItemByCurrentUrl() + private async Task SetSelectedItemByCurrentUrl()And update the callers to await the result.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/BlazorUI/Bit.BlazorUI/Components/Navs/Nav/BitNav.razor.cs
(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build and test
🔇 Additional comments (1)
src/BlazorUI/Bit.BlazorUI/Components/Navs/Nav/BitNav.razor.cs (1)
756-765
: Appropriate update to support nullable itemsThe change to accept a nullable type (
TItem?
) for the parameter is a good improvement that aligns with the PR objective to fix selection issues in auto mode. This will properly handle cases where no matching item is found during URL-based selection.When working with async methods, consider using
await
rather than the discard pattern (_
) when calling the method from non-async contexts.
closes #10192
Summary by CodeRabbit