0
Hello, I’m with a project in Ionic/firebase and has in it a form with about 31 questions and need that on this screen to click to finish instead of back to the top as follows in this function that is in the code this.content.scrollToTop();
i need it to return to the first invalid question. NOTE: I have tried many tutorials on the internet .
Below is an excerpt from my . TS:
enviar(abertura: Abertura) {
if (this.form.form.invalid) {
let confirmAlert = this.alertCtrl.create({
title: 'Parece que há alguma questão sem marcar!',
message: 'Para proseguir, marque o que está faltando!',
buttons: [
{
text: 'Voltar',
handler: () => {
console.log('Voltar clicado');
this.content.scrollToTop();
}
},
]
});
confirmAlert.present();
}
Already tried to focus on invalid element?
– Lucas Brogni