Skip to content

fix(module:cascader): bugfix when ngModel value not existed in options#9124

Merged
Laffery merged 2 commits into
NG-ZORRO:masterfrom
WwwHhhYran:fix/cascade_with_unexisted_option
May 29, 2025
Merged

fix(module:cascader): bugfix when ngModel value not existed in options#9124
Laffery merged 2 commits into
NG-ZORRO:masterfrom
WwwHhhYran:fix/cascade_with_unexisted_option

Conversation

@WwwHhhYran

Copy link
Copy Markdown
Member

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Application (the showcase website) / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Issue Number: close #9107

In addition to the problem mentioned in the issue above, it is not possible to delete the value of ngModel that do not exist in the options when we set nzMultiple = true

link: https://stackblitz.com/edit/5zq3wwrl?file=src%2Fapp%2Fapp.component.ts

👆 no way to remove option light/a

What is the new behavior?

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@WwwHhhYran
WwwHhhYran requested a review from Laffery as a code owner May 16, 2025 11:36
@codecov

codecov Bot commented May 16, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 83.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 92.01%. Comparing base (f4c4e05) to head (73ee17f).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
components/cascader/cascader.component.ts 66.66% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #9124   +/-   ##
=======================================
  Coverage   92.01%   92.01%           
=======================================
  Files         565      565           
  Lines       20064    20067    +3     
  Branches     3012     3012           
=======================================
+ Hits        18461    18464    +3     
  Misses       1264     1264           
  Partials      339      339           

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

Comment thread components/cascader/cascader-tree.service.ts
@WwwHhhYran
WwwHhhYran force-pushed the fix/cascade_with_unexisted_option branch from c13a3ed to 73ee17f Compare May 24, 2025 01:46

@Laffery Laffery left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@Laffery
Laffery merged commit 689fc72 into NG-ZORRO:master May 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nz-cascader 设置的默认值中如果有不在选项中的值 就不能再修改控件的值了

3 participants