描述
如下css, 苹果 14 手机,当键盘弹起时,会遮挡住 bottom-box
这个元素;
.bottom-box{
position:fixed;
bottom:0;
left:0;
right:0;
}
解决
1.层级不要使用默认值,如:.bottom-box
元素增加 z-index: 10;
;
2. 使滚动条延时滚到最下端, 如:window.scrollTo(0, document.body.scrollHeight);
;
3. 如果包含 input
元素, 点击 click 时,使之获取焦点 如:document.querySelector('input').focus();
;