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

nz-input组件中touched不能被正确设置 #117

Closed
tossp opened this issue Aug 21, 2017 · 2 comments · Fixed by #129
Closed

nz-input组件中touched不能被正确设置 #117

tossp opened this issue Aug 21, 2017 · 2 comments · Fixed by #129
Labels

Comments

@tossp
Copy link

tossp commented Aug 21, 2017

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

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

使用FormBuilder构建动态表单,dirty正常,touched一直为false

  ngOnInit() {
    this.LoginForm = this.fb.group({
      'UserName': [null, Validators.compose([Validators.required, Validators.minLength(2), Validators.maxLength(255)])],
      'PassWord': [null, Validators.compose([Validators.required, Validators.minLength(5), Validators.maxLength(255)])],
      'Remember': [true],
    });
  }
<div nz-form-item>
  <div nz-form-control [nzValidateStatus]="LoginForm.get('PassWord')" nzHasFeedback>
    <nz-input formControlName="PassWord" [nzType]="'password'" [nzPlaceHolder]="'密码'" [nzSize]="'large'">
      <ng-template #prefix>
        <i class="anticon anticon-lock"></i>
      </ng-template>
    </nz-input>
    <div nz-form-explain [innerHtml]="LoginForm.get('PassWord') | tsValidate"
         *ngIf="(LoginForm.get('PassWord').dirty||LoginForm.get('PassWord').touched)&&LoginForm.get('PassWord').errors">
    </div>
  </div>
</div>

Environment


Angular version: 4.3.5

ng-zorro-antd version: 0.5.0-rc.2

Browser:
- [x] Chrome (desktop) version 60.0.3112.101


Others:

@vthinkxie
Copy link
Member

bug confirm, thanks.

@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.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants