NZ Select doesn't select the option that has nzValue=undefined and the ngModel value is also `undefined`
See original GitHub issueReproduction link
https://stackblitz.com/edit/angular-sjwmqy?file=src/app/app.component.ts
Steps to reproduce
Create a nz-select with an option that has the [nzValue]=undefined. Set the [(ngModel)] for the nz-select to a variable that has the value undefined
What is expected?
It is expected the nz-select to select the option with the [nzValue]=undefined
What is actually happening?
No options are selected
| Environment | Info |
|---|---|
| ng-zorro-antd | 10.0.2 |
| Browser | * |
As a side node, the HMTL select element works as expected
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Select | NG-ZORRO - Ant Design
Angular Select Component, Select component to select value from options.A dropdown menu for displaying choices - an elegant alternative to the native.
Read more >Angular ngZorro: [(ngModel)] does not pre set <select> tag value
I can display the whole list of reasonList, select a value and get the id, so far so good. Now, when I want...
Read more >ng-zorro/ng-zorro-antd - Gitter
Hey everyone, I am using antd 8.x.x in angular 8, Here facing issue regarding nzPlaceHolder attribute of nz-select. nzPlaceHolder default color is grey...
Read more >Select - Ant Design
Property Description Type Default
allowClear Show clear button. boolean false
autoFocus Get focus by default boolean false
defaultActiveFirstOption Whether active first option by default boolean true...
Read more >How to use Basic ComboBox (Select Option) using NgModel
Angular - How to use Basic ComboBox ( Select Option ) using ngModelif ... new or my video helps with your project. you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

What about “null” as nzValue? It should be considered as value
In @IonelLupu repro “null” behaves like “undefined”
I can drop nz-select value to “null” with nzAllowClear, but nz-option with nzValue=null don`t map
I really need this feature)
@vthinkxie we’ve had this problem too with using
nullas the value, and wanting to “reset” the select back to having a null value.