I am making a webApplication in NextJs. I have to make it responsive for iPphone. The problem I am facing is when the user touches an input box it get disappears under the keyboard if the input is below portion of the screen. What should I do to fix this?
I am currently using direct javascript onFocus scroll workaround, but this not the best. I have to add it to every pages where the input field is available which is not dev friendly.
inputElement.addEventListener('focus', () => {
window.scrollTo({
top: inputElement.offsetTop - 50,
behavior: 'smooth'
});
});
focusevent handler.