-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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:select): accept 0 value on enter #5904
fix(module:select): accept 0 value on enter #5904
Conversation
This preview will be available after the AzureCI is passed. |
d764b1c
to
b5c2d03
Compare
Codecov Report
@@ Coverage Diff @@
## master #5904 +/- ##
==========================================
- Coverage 90.02% 90.01% -0.02%
==========================================
Files 463 463
Lines 13946 13946
Branches 2201 2201
==========================================
- Hits 12555 12553 -2
- Misses 857 859 +2
Partials 534 534
Continue to review full report at Codecov.
|
@vthinkxie I think it's a bug, if |
@vazgen6 Thanks for the PR, no need to a new input here, just correct judgement! + import { isNotNil } from 'ng-zorro-antd/core/util';
- if (this.activatedValue)
+ if (isNotNil(this.activatedValue)) |
I also agree with this, initially I thought doing something similar but was afraid to break existing behavior but since user can click on it they should be able to use enter to select too. |
Sure thing, I will update it asap. |
@hsuanxyz If this is a bug, should I update my commit message? Or let me know what is more accepted, if I amend with new message and force push will it cause any problems for you? |
no problem, you can |
b5c2d03
to
c9a23e1
Compare
c9a23e1
to
6a3213c
Compare
Done! I just fetched from upstream and rebased. Please let me know if there's something else I can do and thank you for your quick reply and support. |
👏 That's right. We'll merge it when @vthinkxie is done reviewing. |
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, good job
😭 Deploy PR Preview 574fdf0 failed. Build logs 🤖 By surge-preview |
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?
When using nz-select component with an option where
[nzValue]="0"
and hitting enter the value is not being saved, becausethis.activatedValue = 0
and it is a falsy value thus not entering the if block to call theonItemClick
method.Issue Number: N/A
What is the new behavior?
Optional @input() was added to solve this problem. By passing
[nzAcceptZeroValue]="true"
toNzSelectComponent
Does this PR introduce a breaking change?
Other information
I don't know Chinese the Chinese docs were Google translated.