The mobile input input box cannot scroll to the visual area immediately after gaining focus.

The

input input box cannot scroll to the visual area immediately after gaining focus, only after entering the content. How should I scroll to the visual area immediately after I want to gain focus?
31546620-5b081132-b024-11e7-851f-51c124bae16f.gif

Mar.20,2021

the solution is as follows:

window.addEventListener('resize', () => {
    const activeElement = document.activeElement
    if (activeElement.tagName === 'INPUT' || activeElement.tagName === 'TEXTAREA') {
        setTimeout(() => {
          activeElement.scrollIntoView()
        }, 100)
      }
    })
Menu