Open Filip-Gugala opened 4 years ago
duplicated #1455
you can disable animation with nzNoAnimation to skip this bug now.
blocked by https://github.com/angular/angular/issues/24041
I found solution. Need use nz-select with *ngIf="visible" and [(nzVisible)]="visible" for nz-dropdown. Example https://stackblitz.com/edit/angular-ksllvu-8udr3r
@LEXXEI I can confirm this workaround works in my case
@LEXXEI Thank you. it works fine.
@vthinkxie While this is a good temporary solution to this exact use case, it doesn't cover the case when you are using ng-content
inside a component (when you have a custom component).
Take a look at this example. The steps to reproduce this are the same.
The only solution I found for this problem is to create an observable where I push the changes of the visible
property, and then use it in my content, just like this
I believe this also occurs when an nz-select
is open inside a modal.
Specifically, if a value was in the multi-select box at the time the modal was closed; the next time the modal is opened having the underlying ngModel
tied to the select with a blank value
the *ngIf
workaround also works in this scenario (though, since I had the nz-select
inside a child-component, I had to toggle the entire component's visibility.
Reproduction link
https://stackblitz.com/edit/angular-ksllvu
Steps to reproduce
What is expected?
Selected items are rendered correctly, no error is thrown after clearing the field.
What is actually happening?
After opening the dropdown again you can see that the selected items are not showing, also clicking the clear search button throws: