-
Notifications
You must be signed in to change notification settings - Fork 4k
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
[nzAutoFocus] can not work in <nz-input-number> #1706
Comments
@wenqi73 Thanks feedback, you can use the following code: import { Component, ViewChild, OnInit } from '@angular/core';
import { NzInputNumberComponent } from 'ng-zorro-antd';
@Component({
selector: 'nz-demo-input-number-basic',
template: `
<nz-input-number [(ngModel)]="demoValue" [nzMin]="1" [nzMax]="10" [nzStep]="1"></nz-input-number>
`
})
export class NzDemoInputNumberBasicComponent implements OnInit {
demoValue = 3;
@ViewChild(NzInputNumberComponent) numberInput;
ngOnInit() {
this.numberInput.focus();
}
} |
This method is actually invoked before ng-zorro-antd/components/input-number/nz-input-number.component.ts Lines 106 to 114 in 4cbcd6f
And this spec cannot represent how things work. Because in this case ng-zorro-antd/components/input-number/nz-input-number.spec.ts Lines 57 to 65 in 4cbcd6f
According to HTML5, |
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. |
Version
1.0.0
Environment
mac OS 10.11 Chrome 67
Reproduction link
https://stackblitz.com/edit/nz-input-number?file=src%2Fapp%2Fapp.component.html
Steps to reproduce
Set [nzAutoFocus]="true"
What is expected?
NzInputNumberComponent is focused
What is actually happening?
NzInputNumberComponent is not focused
Other?
The text was updated successfully, but these errors were encountered: