Skip to content

fix(AutoComplete): skip filter when set SkipMatch to true#8149

Merged
ArgoZhang merged 6 commits into
mainfrom
feat-auto
Jun 22, 2026
Merged

fix(AutoComplete): skip filter when set SkipMatch to true#8149
ArgoZhang merged 6 commits into
mainfrom
feat-auto

Conversation

@ArgoZhang

@ArgoZhang ArgoZhang commented Jun 22, 2026

Copy link
Copy Markdown
Member

Link issues

fixes #8148

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

Ensure AutoComplete respects the SkipMatch flag during filtering and add coverage for post-selection behavior.

Bug Fixes:

  • Prevent AutoComplete from applying TriggerFilter when SkipMatch is set to true, including after an item is selected.

Tests:

  • Add a unit test verifying that AutoComplete does not filter items after selection when SkipMatch is enabled.

bb-auto[bot]
bb-auto Bot previously approved these changes Jun 22, 2026

@bb-auto bb-auto Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Auto approved by bb-auto

@bb-auto bb-auto Bot added the bug Something isn't working label Jun 22, 2026
@bb-auto bb-auto Bot added this to the v10.7.0 milestone Jun 22, 2026
@sourcery-ai

sourcery-ai Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

SkipMatch in AutoComplete now completely bypasses filtering logic, including after a selection, and a regression test was added to ensure items are not filtered when SkipMatch is true.

Sequence diagram for AutoComplete TriggerFilter with SkipMatch

sequenceDiagram
    participant Browser
    participant AutoComplete
    participant OnCustomFilter
    participant OnFilter

    Browser->>AutoComplete: TriggerFilter(val)
    alt [SkipMatch == true]
        AutoComplete-->>Browser: return
    else [SkipMatch == false]
        opt OnCustomFilter != null
            AutoComplete->>OnCustomFilter: OnCustomFilter(val)
            OnCustomFilter-->>AutoComplete: items
        end
        opt OnFilter != null
            AutoComplete->>OnFilter: OnFilter(items)
        end
        AutoComplete-->>Browser: return
    end
Loading

File-Level Changes

Change Details Files
TriggerFilter now short-circuits when SkipMatch is true so that no filtering logic runs in that mode, including after item selection.
  • Added an early-return guard in TriggerFilter to exit immediately when SkipMatch is enabled
  • Ensured OnCustomFilter delegates and matching logic are not invoked when SkipMatch is true
src/BootstrapBlazor/Components/AutoComplete/AutoComplete.razor.cs
Added a regression unit test to verify that SkipMatch remains effective after selecting an item and that the candidate list is not filtered.
  • Rendered AutoComplete with SkipMatch enabled and a fixed list of items
  • Simulated selecting the third dropdown item to reproduce prior behavior
  • Asserted that all items remain in the dropdown after selection, confirming no unintended filtering
test/UnitTest/Components/AutoCompleteTest.cs

Assessment against linked issues

Issue Objective Addressed Explanation
#8148 Ensure that when the AutoComplete SkipMatch parameter is set to true, the component does not apply filtering (TriggerFilter) even after a candidate item is selected, so SkipMatch remains effective.
#8148 Add or update automated tests to cover the behavior of SkipMatch remaining effective after selecting a candidate item in AutoComplete.

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 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Auto approved by bb-auto

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - 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.

@ArgoZhang ArgoZhang merged commit fed3ce0 into main Jun 22, 2026
5 checks passed
@ArgoZhang ArgoZhang deleted the feat-auto branch June 22, 2026 11:38
@codecov

codecov Bot commented Jun 22, 2026

Copy link
Copy Markdown

Codecov Report

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

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #8149   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          766       766           
  Lines        34213     34216    +3     
  Branches      4696      4697    +1     
=========================================
+ Hits         34213     34216    +3     
Flag Coverage Δ
BB 100.00% <100.00%> (?)

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

☔ View full report in Codecov by Harness.
📢 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(AutoComplete): 设置 SkipMatch 参数后选中候选项后失效

1 participant