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

cannot reset select #284

Closed
Akiq2016 opened this issue Sep 13, 2017 · 4 comments · Fixed by #363
Closed

cannot reset select #284

Akiq2016 opened this issue Sep 13, 2017 · 4 comments · Fixed by #363

Comments

@Akiq2016
Copy link

I'm submitting a...


[x] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Support request => Please do not submit support request here

Current behavior

Like #128 but i'm not using in form, just make a simple filter function by using several inputs and selects. my resetFilter function reset data as {}, but the value of select component do not being reset.

Expected behavior

As what two-way binding should do, when my value is changed, it should affect my View.

Minimal reproduction of the problem with instructions

<nz-select [(ngModel)]="data.a" style="width: 100px;" nzAllowClear>
  <nz-option *ngFor="let item of list" [nzLabel]="item.viewValue" [nzValue]="item.value">
  </nz-option>
</nz-select>

<nz-input [(ngModel)]="data.b" style="width: 100px;"></nz-input>

<button type="reset" (click)="resetFilter()">reset</button>
resetFilter() {
  this.data = {}
}
@vthinkxie
Copy link
Member

try this.data={a:null,b:null};

@Akiq2016
Copy link
Author

yeah it works

@vthinkxie
Copy link
Member

vthinkxie commented Sep 13, 2017

@Akiq2016 we will support the reset with undefined next verison. thanks for your feedback.

@lock
Copy link

lock bot commented Feb 19, 2019

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Feb 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants