Skip to content
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

Merged
merged 1 commit into from
Feb 18, 2019

Conversation

wzhudev
Copy link
Member

@wzhudev wzhudev commented Feb 18, 2019

close #2903

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: N/A

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[ ] No

Other information

@netlify
Copy link

netlify bot commented Feb 18, 2019

Deploy preview for ng-zorro-master ready!

Built with commit e40953f

https://deploy-preview-2906--ng-zorro-master.netlify.com

@codecov
Copy link

codecov bot commented Feb 18, 2019

Codecov Report

Merging #2906 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

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

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a67984c...e40953f. Read the comment docs.

@@ -78,7 +78,7 @@
(mouseleave)="onOptionMouseLeave(option, i, $event)"
(click)="onOptionClick(option, i, $event)">
</li>
<li *ngIf="isSearching"
<li *ngIf="isSearching && !columns[0].length"
Copy link
Member

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?

Copy link
Member Author

@wzhudev wzhudev Feb 18, 2019

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

if (!this.columnsSnapshot.length) {
this.columns = [ [] ];
return;
}

And I wrote a test about it. In an earlier. This pr is to fix a regression.

Copy link
Member

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[][] = [ [] ];
?

Copy link
Member Author

@wzhudev wzhudev Feb 18, 2019

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

Copy link
Member

Choose a reason for hiding this comment

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

fine...

Copy link
Member

@vthinkxie vthinkxie left a comment

Choose a reason for hiding this comment

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

LGTM

@vthinkxie vthinkxie merged commit 89c94ee into NG-ZORRO:master Feb 18, 2019
@wzhudev wzhudev deleted the cascader-empty branch February 18, 2019 10:15
Ricbet pushed a commit to Ricbet/ng-zorro-antd that referenced this pull request Apr 9, 2020
hsuanxyz pushed a commit to hsuanxyz/ng-zorro-antd that referenced this pull request Aug 5, 2020
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.

cascader: no result and search result appear at the same time
2 participants