Skip to content

fix(EditorForm): add IsFixed parameter prevent trigger OnParameterSet#7324

Merged
ArgoZhang merged 4 commits intomainfrom
fix-editform
Dec 13, 2025
Merged

fix(EditorForm): add IsFixed parameter prevent trigger OnParameterSet#7324
ArgoZhang merged 4 commits intomainfrom
fix-editform

Conversation

@ArgoZhang
Copy link
Copy Markdown
Member

@ArgoZhang ArgoZhang commented Dec 13, 2025

Link issues

fixes #7312

Summary By Copilot

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Merge the latest code from the main branch

Summary by Sourcery

Enhancements:

  • Mark the EditorForm cascading value as fixed so that descendants do not re-run parameter binding when the EditorForm reference remains the same.

Copilot AI review requested due to automatic review settings December 13, 2025 12:45
@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Dec 13, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This PR adjusts the EditorForm cascading values so that the EditorForm instance is treated as a fixed cascading value, preventing unnecessary OnParametersSet triggers, while leaving the editor items collection dynamic.

Sequence diagram for EditorForm cascading value with IsFixed optimization

sequenceDiagram
    actor User
    participant Browser
    participant ParentComponent
    participant EditorForm
    participant CascadingValue_EditorItems as CascadingValue_EditorItems
    participant CascadingValue_EditorForm as CascadingValue_EditorForm_IsFixedTrue
    participant ChildEditorItem

    User->>Browser: Interact with page
    Browser->>ParentComponent: Trigger state change
    ParentComponent->>EditorForm: Render EditorForm
    EditorForm->>CascadingValue_EditorItems: Provide _editorItems(IsFixed=false)
    CascadingValue_EditorItems->>ChildEditorItem: Update cascading parameter editorItems
    ChildEditorItem->>ChildEditorItem: OnParametersSet (editorItems changed)

    EditorForm->>CascadingValue_EditorForm: Provide this(IsFixed=true)
    CascadingValue_EditorForm->>ChildEditorItem: Initial cascading parameter EditorForm
    ChildEditorItem->>ChildEditorItem: OnParametersSet (EditorForm set first time)

    loop Subsequent ParentComponent renders
        Browser->>ParentComponent: Further state change
        ParentComponent->>EditorForm: Re-render EditorForm
        EditorForm->>CascadingValue_EditorItems: Update _editorItems(IsFixed=false)
        CascadingValue_EditorItems->>ChildEditorItem: Update cascading parameter editorItems
        ChildEditorItem->>ChildEditorItem: OnParametersSet (editorItems changed)

        EditorForm->>CascadingValue_EditorForm: Provide this(IsFixed=true)
        CascadingValue_EditorForm--xChildEditorItem: No cascading update (value fixed)
        ChildEditorItem->>ChildEditorItem: OnParametersSet not triggered by EditorForm
    end
Loading

File-Level Changes

Change Details Files
Make the EditorForm instance a fixed cascading value to avoid re-triggering parameter updates.
  • Set IsFixed="true" on the CascadingValue providing the EditorForm instance while keeping the editor items CascadingValue non-fixed
  • Left the overall EditorForm component structure intact, only modifying the CascadingValue configuration
  • Normalized the file encoding/BOM at the top of the EditorForm.razor file without functional impact
src/BootstrapBlazor/Components/EditorForm/EditorForm.razor

Assessment against linked issues

Issue Objective Addressed Explanation
#7312 Ensure that when a MultiSelect component is nested inside an EditorForm, it displays the expected text content instead of the underlying value/ID.

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@bb-auto bb-auto Bot added the bug Something isn't working label Dec 13, 2025
@bb-auto bb-auto Bot added this to the v10.1.0 milestone Dec 13, 2025
@ArgoZhang ArgoZhang merged commit 258c546 into main Dec 13, 2025
5 of 6 checks passed
@ArgoZhang ArgoZhang deleted the fix-editform branch December 13, 2025 12:45
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey there - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR optimizes the EditorForm component's cascading value behavior to prevent unnecessary OnParametersSet calls in child components. The change addresses issue #7312 by adding the IsFixed="true" parameter to the CascadingValue that provides the EditorForm instance to descendants.

Key changes:

  • Added IsFixed="true" to the EditorForm CascadingValue to prevent unnecessary parameter updates in child components
  • Removed BOM (Byte Order Mark) character from the Razor file
  • Changed version from 10.1.4-beta05 to 10.1.3

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/BootstrapBlazor/Components/EditorForm/EditorForm.razor Added IsFixed="true" to the EditorForm CascadingValue to optimize performance by preventing unnecessary OnParametersSet calls in descendant components like DisplayBase
src/BootstrapBlazor/BootstrapBlazor.csproj Version changed from 10.1.4-beta05 to 10.1.3, which appears to be a version downgrade

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


<PropertyGroup>
<Version>10.1.4-beta05</Version>
<Version>10.1.3</Version>
Copy link

Copilot AI Dec 13, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version has been changed from 10.1.4-beta05 to 10.1.3, which represents a downgrade from a beta version to an older stable version. This appears to be unintentional and could cause confusion in versioning. If this is a fix for version 10.1.3, consider using 10.1.3.1 or 10.1.4 instead. If this is intentional, please clarify the versioning strategy.

Copilot uses AI. Check for mistakes.
@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 13, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (dbae1d0) to head (e4092fa).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #7324   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          747       747           
  Lines        32714     32714           
  Branches      4534      4534           
=========================================
  Hits         32714     32714           
Flag Coverage Δ
BB 100.00% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(MultiSelect): 组件在 EditorForm 组件中始终显示 Value 值

2 participants