1.寫個js即可(對於vue項目,將js寫在mounted即可)
// 處理安卓手機輸入法遮擋輸入框問題
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();
}, 0);
}
});
}
寫上這段js 點擊input 會自動將input顯示在可視區域