Greetings! I am developing an application in ionic where the focus is the usability in it and one of the problems that I am facing is that the ‘next’ button in the device never opens the ion-select, when the component is directly the next one.
I am able to open it programmatically, which for some cases it would solve already, but when the form is too mixed it is impossible to deal with all the changes, the user jumps over 3 inputs since it only goes from one input text to another.
I’ve attempted to capture the keycode for it to make it manually like this:
@HostListener(‘keydown’, [‘$event’]) onInputChange(e) {
var code = e.keyCode || e.which;
console.log(code);
}
But the next button doesn’t trigger any code.
For the select, programmatically, I do like this:
@ViewChild(“pesoSelect”) pesoSelect: IonSelect;
…
this.pesoSelect.open();
Which work normally.
One example of one of my forms:
Nome do Talhão *:<ion-row> <ion-col size="12"> <ion-item> <ion-label position="floating">Cultura <span>*</span>:</ion-label> <ion-select #culturaSelect formControlName="cultura" name="cultura" required (ionChange)="changeCultura($event)" okText="Selecionar" cancelText="Cancelar" placeholder="Selecione"> <ion-select-option *ngFor="let cultura of foundCulturas" [value]="cultura">{{cultura.nome}}</ion-select-option> </ion-select> </ion-item> </ion-col> </ion-row> <ion-row> <ion-col size="12"> <ion-item> <ion-label position="floating">Variedade <span>*</span>:</ion-label> <ion-input name="variedade" formControlName="variedade" placeholder="Digite uma variedade"></ion-input> </ion-item> </ion-col> </ion-row> <ion-row> <ion-col size="12"> <ion-item> <ion-label position="floating">Responsável</ion-label> <ion-select formControlName="relacionamento" name="relacionamento" okText="Selecionar" cancelText="Cancelar" placeholder="Selecione"> <ion-select-option *ngFor="let funcionario of foundRelacionamentos" [value]="funcionario">{{funcionario.nome}}</ion-select-option> </ion-select> </ion-item> </ion-col> </ion-row> <ion-row> <ion-col size="12"> <ion-item> <ion-label position="floating">Und. de Medida de Área <span>*</span>:</ion-label> <ion-select formControlName="unidadeMedidaArea" name="unidadeMedidaArea" required okText="Selecionar" cancelText="Cancelar" placeholder="Selecione"> <ion-select-option *ngFor="let medida of foundUnidadeMedidaArea" [value]="medida">{{medida.nome}}</ion-select-option> </ion-select> </ion-item> </ion-col> </ion-row> <ion-row> <ion-col size="6 "> <ion-item> <ion-label position="floating">Área Total <span>*</span>:</ion-label> <ion-input formControlName="area" name="area" required type="tel"></ion-input> </ion-item> </ion-col> <ion-col size="6"> <ion-item> <ion-label position="floating">Sigla <span>*</span>:</ion-label> <ion-input formControlName="sigla" name="sigla" required></ion-input> </ion-item> </ion-col> </ion-row>
As you can see, I have the following sequence:
- Input text
- Select
- Input text
- Select
- Select
- Input Text
- Input Text
If, from the start, I go clicking next in the keyboard, it will from in the following sequence:
1 → 3 → 6 → 7
Can anyone assist me with this behavior?
Kind Regards