Hello, I have a project in ionic / firebase and it has a form with about 31 questions and I need it on this screen to click to finish instead of going back to the top as follows in this function that is in code
this.content.scrollToTop();
I need him to return to the first invalid question. I've tried many tutorials on the internet.
Here 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();
}