fix(LinkButton): missing class attribute#7007
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRefactored LinkButton rendering to apply AdditionalAttributes before built-in attributes, ensuring the class attribute is correctly set and preventing override issues by updating sequence indexes. Class diagram for updated LinkButton attribute renderingclassDiagram
class LinkButton {
+BuildRenderTree(RenderTreeBuilder builder)
-ClassString : string
-UrlString : string
-Target : string
-Disabled : bool
-DisabledString : string
-Tab : int
-Id : string
-TriggerClick : bool
-AdditionalAttributes : IDictionary<string, object>
}
LinkButton --|> ButtonBase
Flow diagram for LinkButton attribute rendering orderflowchart TD
A["OpenElement(TagName)"] --> B["AddMultipleAttributes(AdditionalAttributes)"]
B --> C["AddAttribute(class, ClassString)"]
C --> D["AddAttribute(href, UrlString)"]
D --> E["AddAttribute(target, Target)"]
E --> F["AddAttribute(disabled, Disabled)"]
F --> G["AddAttribute(aria-disabled, DisabledString)"]
G --> H["AddAttribute(tabindex, Tab)"]
H --> I["AddAttribute(id, Id)"]
I --> J["AddAttribute(role, 'button')"]
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.
Pull Request Overview
This PR fixes a missing class attribute issue in the LinkButton component by reordering attribute addition so that AdditionalAttributes is added before the class attribute. This ensures that any class attribute specified in AdditionalAttributes is properly overridden by the component's ClassString. The PR also increments the package version numbers.
Key Changes:
- Reordered
AddMultipleAttributesto be called beforeAddAttributefor the class attribute in LinkButton - Updated version numbers for both VS 17.0 and 18.0 configurations
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/BootstrapBlazor/Components/Button/LinkButton.cs | Moved AddMultipleAttributes call before individual attributes to ensure proper class attribute precedence |
| src/BootstrapBlazor/BootstrapBlazor.csproj | Bumped version numbers to 9.11.5-beta06 and 10.0.0-rc.2.1.5 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7007 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 741 741
Lines 32397 32397
Branches 4485 4485
=========================================
Hits 32397 32397
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 #7006
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Bug Fixes: