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

nzValidateStatus & nzHasFeedback overlap with nzSuffix #3607

Closed
Svetomechc opened this issue Jun 19, 2019 · 12 comments · Fixed by #3633
Closed

nzValidateStatus & nzHasFeedback overlap with nzSuffix #3607

Svetomechc opened this issue Jun 19, 2019 · 12 comments · Fixed by #3633

Comments

@Svetomechc
Copy link
Contributor

Svetomechc commented Jun 19, 2019

Reproduction link

https://stackblitz.com/edit/ng-zorro-antd-start-zahkan

Steps to reproduce

<form nz-form>
	<nz-form-item>
		<nz-form-label [nzSpan]="5">Password</nz-form-label>
		<nz-form-control [nzSpan]="12" nzValidateStatus="success" nzHasFeedback>
			<nz-input-group [nzSuffix]="suffixTemplate">
				<input
        [type]="passwordVisible ? 'text' : 'password'"
        nz-input
        placeholder="input password"
        [(ngModel)]="password"
      />
    </nz-input-group>
        </nz-form-control>
      </nz-form-item>
</form>

<ng-template #suffixTemplate>
      <i nz-icon [nzType]="passwordVisible ? 'eye-invisible' : 'eye'" (click)="passwordVisible = !passwordVisible"></i>
</ng-template>

What is expected?

Icons are displayed next to each other

What is actually happening?

Icons overlap

Environment Info
ng-zorro-antd 7.5.1
Browser 77.0.3824.6

P.S. Issue Helper can't handle "&" sign:

  1. Issue title
    image

  2. Issue title after pressing "Create"
    image

@vthinkxie
Copy link
Member

Hi @Svetomechc
you can add the style below as temp solution, we will release the fix version in 8.0.0

form .has-feedback .ant-input-suffix i {
    margin-right: 18px;
}

@Svetomechc
Copy link
Contributor Author

Thank you. I will wait for 8.0.0 (I already worked around this issue for now).

@Svetomechc
Copy link
Contributor Author

Svetomechc commented Jun 23, 2019

Tried release candidate. I am really sorry to say that your fix is quite subpar because it adds a constant margin, no matter if there are two icons or one.

See demonstration:

  1. This is OK
    image

  2. This is NOT
    image

Previously icons would always stick to the right. But now second image looks like a regression from ng-zorro-antd 7.x.x.

@Svetomechc
Copy link
Contributor Author

@vthinkxie, please reopen.

@Svetomechc
Copy link
Contributor Author

Still the same.

@vthinkxie
Copy link
Member

@Svetomechc
the fix version has not released yet

@Svetomechc
Copy link
Contributor Author

@vthinkxie oh sorry, my bad.

@Svetomechc
Copy link
Contributor Author

@vthinkxie By the way, thank you for all your hard work and patience. Much appreciated (:

@vthinkxie
Copy link
Member

try this

form .has-feedback.has-success .ant-input-suffix i,
form .has-feedback.has-error .ant-input-suffix i,
form .has-feedback.is-validating .ant-input-suffix i{
    margin-right: 18px;
}

@Svetomechc
Copy link
Contributor Author

@vthinkxie this still makes [nzSuffix] position a bit off.

  1. With fix above
    image

  2. Should be
    image

@vthinkxie
Copy link
Member

@Svetomechc
Copy link
Contributor Author

Svetomechc commented Jun 25, 2019

Hmm, looks OK to me. Have to investigate why it doesn't work in my case. I will provide a repro link.

As a side note, I think [nzSuffix] should be displayed to the right of [nzHasFeedback] icon, not to the left.

Ricbet pushed a commit to Ricbet/ng-zorro-antd that referenced this issue Apr 9, 2020
Ricbet pushed a commit to Ricbet/ng-zorro-antd that referenced this issue Apr 9, 2020
hsuanxyz pushed a commit to hsuanxyz/ng-zorro-antd that referenced this issue Aug 5, 2020
hsuanxyz pushed a commit to hsuanxyz/ng-zorro-antd that referenced this issue Aug 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants