Skip to content

Fix HtmlAttribute parsing issues (#13546) - #13758

Merged
msynk merged 2 commits into
developfrom
msynk/13546-htmlattributes-parameter
Oct 11, 2026
Merged

msynk merged 2 commits into
developfrom
msynk/13546-htmlattributes-parameter

Conversation

@msynk

@msynk msynk commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

closes #13546

Summary by CodeRabbit

  • Bug Fixes
    • Supplied HTML attributes are now applied to the component’s root element, rather than appearing as a literal HtmlAttributes attribute.
    • When a supplied attribute conflicts with one set directly by the component, the component-set value takes precedence, regardless of casing.
    • The supplied attribute dictionary remains unchanged, and attributes no longer supplied are removed on subsequent renders.

@msynk
msynk requested a review from yasmoradi as a code owner October 10, 2026 08:42
@coderabbitai

coderabbitai Bot commented Oct 10, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 07dd4db1-ff3d-4196-a9c3-8ae25a02148c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bcab792b-31e1-4c3b-8ca6-7b4e4d2f1cbf


📥 Commits

Reviewing files that changed from the base of the PR and between 291a5de and ac8f926.



📒 Files selected for processing (3)
  • src/BlazorUI/Bit.BlazorUI/Components/BitComponentBase.cs
  • src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/DemoPage.razor.cs
  • src/BlazorUI/Tests/Bit.BlazorUI.Tests/Components/BitComponentBaseHtmlAttributesTests.cs


Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.




Walkthrough

BitComponentBase now merges entries from an explicitly supplied HtmlAttributes dictionary into component attributes. Component-written attributes take precedence, and the supplied dictionary remains unchanged.

Changes

HtmlAttributes parameter handling

Layer / File(s) Summary
Capture and merge HtmlAttributes
src/BlazorUI/Bit.BlazorUI/Components/BitComponentBase.cs, src/BlazorUI/Demo/Client/Bit.BlazorUI.Demo.Client.Core/Components/DemoPage.razor.cs, src/BlazorUI/Tests/Bit.BlazorUI.Tests/Components/BitComponentBaseHtmlAttributesTests.cs
SetParametersAsync saves the explicit dictionary and merges its entries into HtmlAttributes. Component-written attributes take precedence in case-insensitive name collisions. Tests cover rendering, component lookups, dictionary preservation, rerenders, and cascading BitParams entries.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to ac8f9

No actionable issue is identified; the change appears mergeable after normal checks.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 10.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title describes the main change: fixing HtmlAttributes handling and parsing issues. It is concise and includes the related issue number.
Linked Issues check Passed Issue #13546 requires explicit HtmlAttributes dictionaries to be splatted and readable by component logic, with a base-class test. BitComponentBase.SetParametersAsync now captures the named dictio…
Out of Scope Changes check Passed The changes stay within issue #13546. The BitComponentBase documentation describes the implemented merge behavior, the demo documentation reflects the precedence rule, and the added tests cover the …



✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR



🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR



  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

A rabbit checks each attribute in the moonlit glow,
The supplied dictionary stays as it was, you know.
Component-written values keep their place,
While merged entries join the markup’s space.
“Hop!” says the rabbit, “the tests show the flow!”

Comment @coderabbitai help to get the list of available commands.

@msynk
msynk merged commit c36ccfd into develop Oct 11, 2026
8 checks passed
@msynk
msynk deleted the msynk/13546-htmlattributes-parameter branch October 11, 2026 04:48
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.

BlazorUI: explicitly passing the HtmlAttributes parameter renders a bogus attribute instead of splatting its entries

1 participant