Prevent scrollAssist & autoFocus on inputs that don't need keyboard to show

Viewed 1718

I built an Angular Reactive Form using Ionic 2.

When I was touching an input at the bottom of the page the page would scroll so the input get above the keyboard. Expected behavior, so ok. But the header was push too and that was wrong.

So I looked on the internet and find a workaround which was to write the following in the import statement of app.module.ts

// app.module    
IonicModule.forRoot(MyApp, {
   scrollAssist: true,
   autoFocusAssist: true
})

That indeed works well as the page still scrolls and the header is not push away.

But I still have one problème. When I touch an input which doesn't need the keyboard to be shown (eg. datepicker) the page scroll on the first touch and I have to touch again so the datepicker opens...

Any idea on how I could may be prevent the page to auto-scroll when touching an input that doesn't need the keyboard?

1 Answers
Related