-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(module:cascader): fix empty shown when searching value #2906
Conversation
Deploy preview for ng-zorro-master ready! Built with commit e40953f |
Codecov Report
@@ Coverage Diff @@
## master #2906 +/- ##
=======================================
Coverage 97.36% 97.36%
=======================================
Files 526 526
Lines 11026 11026
Branches 786 786
=======================================
Hits 10736 10736
Misses 189 189
Partials 101 101 Continue to review full report at Codecov.
|
@@ -78,7 +78,7 @@ | |||
(mouseleave)="onOptionMouseLeave(option, i, $event)" | |||
(click)="onOptionClick(option, i, $event)"> | |||
</li> | |||
<li *ngIf="isSearching" | |||
<li *ngIf="isSearching && !columns[0].length" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
columns[0] may be null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vthinkxie This is secured here
ng-zorro-antd/components/cascader/nz-cascader.component.ts
Lines 715 to 718 in 07f76af
if (!this.columnsSnapshot.length) { | |
this.columns = [ [] ]; | |
return; | |
} |
And I wrote a test about it. In an earlier. This pr is to fix a regression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
columns: CascaderOption[][] = []; |
should be
columns: CascaderOption[][] = [ [] ];
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If so there would be an blank dropdown. According to ant design, when there's nothing selectable, the dropdown shouldn't appear at all. But when you started searching it appears. Mystery. XD Try this: https://ant.design/components/empty/#components-empty-demo-config-provider
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fine...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
close #2903
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information