//. container sets the overflow attribute, which causes the input method to block the bug in the input box when the input box under the Android phone gets the focus //Related issue: https://github.com/weui/weui/issues/15 //Solution: // 0. . The container removes the overflow attribute, but this demo will cause other problems // 1.  reference resources http://stackoverflow.com/questions/23757345/android-does-not-correctly-scroll-on-input-focus-if-not-body-element //On Android phones, when input or textarea elements are focused, take the initiative to roll if (/Android/gi.test(navigator.userAgent)) { window.addEventListener('resize', function () { if (document.activeElement.tagName == 'INPUT' || document.activeElement.tagName == 'TEXTAREA') { window.setTimeout(function () { //document.activeElement.scrollIntoViewIfNeeded(); document.activeElement.scrollIntoView(); }, 0); } }) }

At first, I found the above code. If the commented code is invalid weui/issues/577 New method found in:
take document.activeElement.scrollIntoViewIfNeeded Change to document.activeElement.scrollIntoView
This function can be realized instead.

Last modification: July 10, 2018
If you think my article is useful to you, please feel free to appreciate it